microcache wont rewarm with new requests

Discussion in 'Installation/Configuration' started by domoarrigato, Feb 7, 2014.

  1. domoarrigato

    domoarrigato New Member

    My website is a Drupal 7 site serving mostly static content. I am currently using nginx + php-fcgi backend. I am running varnish on the front end. I have nginx microcache configured (15s for a 200 response), and it initially works as expected, but when the cache expires, subsequent requests fail to re-warm the cache, and it just misses. On loading, this swamps my backend.

    ## The cache zone referenced.
    fastcgi_cache microcache;
    fastcgi_cache_key $host$request_uri;
    fastcgi_cache_valid 200 301 15s;
    fastcgi_cache_valid 302 1m;
    fastcgi_cache_valid 404 1m;
    fastcgi_cache_use_stale error timeout invalid_header updating http_500;
    fastcgi_ignore_headers Cache-Control Expires;
    fastcgi_cache_bypass $no_cache;
    fastcgi_no_cache $no_cache;
    add_header X-Micro-Cache $upstream_cache_status;
    expires epoch;​

    I think I should be getting hits for 15s, then one miss, which should trigger a php5-fpm process spawn, and should rewarm the cache. I should be getting served stale cached data in the meantime. Instead, curling headers at 1s intervals, I get 1 miss, 15s worth of hits, an Expired response, and then non-stop misses with new etags. If I let it sit for a while - like 30 seconds or so, I can get the process to start again, however, if I keep loading it misses continue indefinitely.
     

Share This Page