Answers.Body: <p>You mention you're using cache, which could mean a whole lot of things, but the symptoms you're describing are typical of what you'd see if you're doing some heavy-handed things inside of a <a href="https://craftcms.com/docs/templating/cache" rel="nofollow">{% cache %}</a>, you let that expire, then you're the first person to hit the page when the cache has to rebuild.</p>
  
  <p>That <code>{% cache %}</code> tag, by <a href="https://craftcms.com/docs/config-settings#cacheDuration" rel="nofollow">default</a>, will purge its cache every 24 hours unless you've specified otherwise.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-02T13:31:12.923Z
Answers.Text: Thanks. Yes when the cache expired it goes up quite a lot (100 queries to build the 3 level nav menu), but it can happen multiple times within 24h. I should find a way to optimize this nested menu instead.
Answers.UserDisplayName: Frabo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-02T16:30:36.123Z
Answers.Text: Maybe you've got other levels of caching going on as well and they're expiring (Varnish, PHP opcache, etc.)
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-02T05:17:31.957Z
Answers.LastActivityDate: 2016-06-02T05:17:31.957Z
Answers.UserDisplayName: Brad Bell
Body: <p>I noticed my Craft website is slower to load when it has been idle for awhile. It can take up to 3-4 seconds for the first load, and then it goes down to about 500ms (which is fine) after the first page. I'm also using cache so I could get my query count to about 20-30 per page. I have other websites (non Craft) on the server that are fast to load even when they have been idle for awhile. Any idea what's causing this? </p>
  
Tags: <cache><performance>
Title: Slow initial response time when website has been idle?
ThreadText: # Slow initial response time when website has been idle?
  
  (Asked by: username_0 on 2016-06-01)
  
  I noticed my Craft website is slower to load when it has been idle for awhile. It can take up to 3-4 seconds for the first load, and then it goes down to about 500ms (which is fine) after the first page. I'm also using cache so I could get my query count to about 20-30 per page. I have other websites (non Craft) on the server that are fast to load even when they have been idle for awhile. Any idea what's causing this?
  
  **Tags:** cache, performance
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-06-02. Score: 2
  
  You mention you're using cache, which could mean a whole lot of things, but the symptoms you're describing are typical of what you'd see if you're doing some heavy-handed things inside of a [{% cache %}](https://craftcms.com/docs/templating/cache), you let that expire, then you're the first person to hit the page when the cache has to rebuild.
  
  That `{% cache %}` tag, by [default](https://craftcms.com/docs/config-settings#cacheDuration), will purge its cache every 24 hours unless you've specified otherwise.
  
  > **Comments:**
  > **username_0**: Thanks. Yes when the cache expired it goes up quite a lot (100 queries to build the 3 level nav menu), but it can happen multiple times within 24h. I should find a way to optimize this nested menu instead.  
  > **username_1**: Maybe you've got other levels of caching going on as well and they're expiring (Varnish, PHP opcache, etc.)  
  
  ---
  
  