Closed EvanK closed 7 years ago
For reference, to reboot the entire server when nothing else works: sudo reboot now
in an ssh term
According to the varnish mailing lists, a service restart should entirely clear existing cache storage...but we're seeing evidence that it doesn't necessarily.
It could be that the storage file is being reloaded and re-using existing cache objects, rather than being zeroed and recreated.
One alternative may be to add a cap task for forcing purge/ban of all cache objects (possibly followed by another service restart): sudo varnishadm -S /etc/varnish/secret "ban.url . "
Another alternative would be to force ban of cache objects matching a given url and/or extension:
sudo varnishadm -S /etc/varnish/secret "ban req.http.host ~ staging.example.com"
sudo varnishadm -S /etc/varnish/secret "ban req.http.host ~ staging.example.com && req.url ~ .css"
I've added a :cache:clear
cap task for the express purpose of force-clearing cache objects, either wholesale by domain or specifically by url:
Witnessed an issue where, after a deployment and repeated restarts of both apache and varnish services, a particular minified javascript file was still returning a cached version from pre-deployment.
We verified the file on the filesystem was up to date, and that varnish was restarted (by hand even!), but continued to return a stale version of the file in question.
Finally resolved it by ssh-ing into the server and purging the url specifically:
It worries me that restarting everything short of the entire damned server failed to purge a stale file, and I'll have to investigate further a possible root cause. In the meantime, and for easier purging, we may want to add a capistrano task for purging a given url (and on a given hostname)