Answers.Body: <p>Not the answer you'd be hoping for but the advice I got was to create a plugin to listen and clear the cache when a new entry was published <a href="https://twitter.com/craftcms/status/541968671300911104" rel="nofollow">https://twitter.com/craftcms/status/541968671300911104</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-09T21:54:13.567Z
Answers.Text: I think that tweet assumed you were talking about data caches (by default in `craft/storage/runtime/cache`), not template caches (stored in the database).
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-09T21:29:01.187Z
Answers.LastActivityDate: 2014-12-09T21:29:01.187Z
Answers.UserDisplayName: Steven Grant
Body: <p>I'm using <code>{% cache %}</code> to cache pages, but it seems that the caches are not invalidated after posting new content, which is what I thought should happen.</p>
  
  <p>I've investigated the situation and what I think is happening is this:</p>
  
  <ul>
  <li>Post a new entry</li>
  <li>Caches are then deleted (this process takes a looong time: I noticed that templatecacheelements table was up to something like 450,000 rows)</li>
  <li>The page in question is accessed by a visitor while the cache is being invalidated, and so the template is cached again before it has been purged</li>
  </ul>
  
  <p>Because Craft doesn't know about the access to the template during emptying of the caches, I suppose it never will until the cache is purged manually.</p>
  
  <p>Is there anything I can do to improve this situation?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-09T21:28:15.877Z
Comments.Text: Possible duplicate?  See answer here: http://craftcms.stackexchange.com/a/2071/57
Comments.UserDisplayName: Brad Bell
Tags: <cache>
Title: Cache not invalidated on publishing new entry
ThreadText: # Cache not invalidated on publishing new entry
  
  (Asked by: username_0 on 2014-12-09)
  
  I'm using `{% cache %}` to cache pages, but it seems that the caches are not invalidated after posting new content, which is what I thought should happen.
  
  I've investigated the situation and what I think is happening is this:
  
  * Post a new entry
  * Caches are then deleted (this process takes a looong time: I noticed that templatecacheelements table was up to something like 450,000 rows)
  * The page in question is accessed by a visitor while the cache is being invalidated, and so the template is cached again before it has been purged
  
  Because Craft doesn't know about the access to the template during emptying of the caches, I suppose it never will until the cache is purged manually.
  
  Is there anything I can do to improve this situation?
  
  **Tags:** cache
  
  > **Comments:**
  > **username_1**: Possible duplicate?  See answer here: http://craftcms.stackexchange.com/a/2071/57  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-12-09. Score: 1
  
  Not the answer you'd be hoping for but the advice I got was to create a plugin to listen and clear the cache when a new entry was published <https://twitter.com/craftcms/status/541968671300911104>
  
  > **Comments:**
  > **username_1**: I think that tweet assumed you were talking about data caches (by default in `craft/storage/runtime/cache`), not template caches (stored in the database).  
  
  ---
  
  