CodeIgniter Forums
Cache continues to show until hard refresh - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Cache continues to show until hard refresh (/showthread.php?tid=66131)



Cache continues to show until hard refresh - edoramedia - 09-10-2016

We are using the web page caching of CI:
https://www.codeigniter.com/user_guide/general/caching.html

However for some users who have recently seen that specific page even when we manually delete the cache they continue to see the cached version until they actually do a hard refresh in which then they see the updated version.

How can we resolve this issue?


RE: Cache continues to show until hard refresh - PaulD - 09-10-2016

This may be because browsers cache pages themselves. So a user that visits a page can sometimes be seeing what their browser has cached previously, not what is actually being delivered. This most often manifests itself for me when I change an image but not it's name and get customers emailing saying 'but the image hasn't changed', 'Try pressing refresh', 'Oh there it is' type conversations. Different browsers cache content in different ways, but it is all intended to speed up browsing for the user.

You could put a version into the url, which actually does nothing to the page but the browser will think it is a different page being requested, but that is a pain and probably overkill.

The other way is with headers described well here:
http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers

Again, I am not sure this is the best approach for your users, as this will slow down their browsing especially with back buttons and other normal user behavior. It all depends on your aims I suppose.

Paul.