Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to cache pages on my nginx site for fast retrieval. Let's say every 5 hours I want to expire all the cache and have it recreated. Will Varnish make calls to the web-server and recreate cache on it's own or will it have to wait till a user requests a page?

share|improve this question

No, Varnish does not generate requests that re-create its caches.

You need to make a manual refresh of the pages in order to get the cache warm.

share|improve this answer

varnishd - HTTP accelerator daemon, it's not it's job to handle those kind of things, but what you can do is schedule a cron job (using curl, wget, etc) that would trigger hitting pages that you like and Varnish will cache them.


[alexus@wcmisdlin02 ~]$ curl --help | grep -- '--silent'
 -s/--silent        Silent mode. Don't output anything
[alexus@wcmisdlin02 ~]$ 


[alexus@wcmisdlin02 ~]$ wget --help | grep -- '--quiet'
  -q,  --quiet               quiet (no output).
[alexus@wcmisdlin02 ~]$ 
share|improve this answer
curl or wget? I don't need the results, I just have to "call" the page and have it triggered without transferring content – Jimbotron Aug 27 '14 at 20:24
@Jimbotron you can always redirect redirect output to >/dev/null) – alexus Aug 27 '14 at 21:19
Yes I can do that but it's still a waste of data transfer. Is there no way to call and abandon request? – Jimbotron Aug 28 '14 at 20:51
@Jimbotron it's not a waste as Varnish need to preserve a copy of it for next serve it for next user, if something you just doing work on behalf of user, so that user doesn't have to wait for the backend. – alexus Aug 28 '14 at 20:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.