Page Cache not invalidating when page is published
Changing a contentlet on a page and using Save, then publishing the page results in the old version of the contentlet still being served from cache until expiration or manually flushing the cache.
Steps to Reproduce (for bugs)
a. Login to demo site as admin. b. Open Site-->Browser-->demos-->form-success b1. make sure page has a long TTL and is loaded in page cache (hit it with an incognito browser) c. Lock for editing d. Click on Edit Content. e. A new page will open where Title is "Thank You". f. Change the Body content from "Thank you for contacting us." to "Thank you" e. Click on Save after the change. (Do not Save/Publish this change) f. Release the lock and you will be back to form-success page. g. Click on "Publish Page" and then click "Ok" in the pop-up. h. Click on "Publish all related assets". i. Now, you can see the Text change in the Preview mode. j. Switch to "Live" mode, it still shows older text even though page has been published. k. Hit it again with your incognito browser k. Flush cache and the correct Live mode content displays
https://dotcms.zendesk.com/agent/tickets/94476
Your Environment
- dotCMS version used: 4.1.1
- Browser Name and version: Any
- Operating System and version: Any
- Application Server and version: Bundled tomcat
- Java Brand and version: Oracle Java 8
- Database and version: postgres
I think this may be intended behavior.
The page (including all contents added to its containers) will normally be cached for the length of the Cache TTL value in the page properties, even after a change is made to the page. To check to see if this issue is an interaction with the page cache, you can set the Cache TTL on the page to 0 and see if the change shows up immediately when you repeat the steps above.
If this is being caused by the page cache, then it's an open question whether this is behavior we want to keep, or whether it would make more sense for the system to automatically flush the page cache when the page is published.
Add the live page inode to the page cache key
PR core: https://github.com/dotCMS/core/pull/13138
Passed QA. Mac OS 10.10 / Postgres 9.3.7 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8