By Tommy_001 on
I have just found out that visitors watch old versions of my site, because of client side caching (even after restarting the computer every day, which is odd...). When instructing a visitor to press Ctrl + F5 to refresh the page, everything looked good again. Apparently some browsers reload the cache even after re-starting the computer.
Now to my question. Is there any Drupal way to force the client-side browser to refresh pages with changed content?
I use Boost och Cache Expiration on my site for server-side caching by the way.
Thank's in advance for any advice.
Comments
If you turn CSS and JS
If you turn CSS and JS aggregation on and then clear the caches (in D7 there's a button for that on the Performance settings page, maybe the same in D8) then that will do the trick.
Thanks for your answer.
Thanks for your answer.
No, that does not help. I have flushed all server-side caches many times. How would that effect the caching in client-side browsers?
CSS and JS aggregation is enabled by the way. The client side cached content was images that I had changed, but the old images was still visible in some client side browsers weeks after the changes was made.
Oh, I see. Yeah the drupal
Oh, I see. Yeah the drupal caches don't affect images at all, only CSS and JS.
This is more of a server configuration issue than a drupal one - the HTTP headers that determine when content should be removed from the browser cache must be set to be too long in the future. You might be able to add something to the .htaccess file in the root of your site to control this. Google for 'set expires header htaccess' (assuming you're using Apache...)
Aha, ok, your answer could be
Aha, ok, your answer could be helpful. We are using ngingx and I have used external help to set that server up. I will get in touch with them to see if anything could be changed in the configuration, to shorten the caching time. Thanks!
content on clients' browser
Once the content is already delivered and cached at client end; can this be cleared now, from server side configurations...?
Flush all the Cache
Flush all the cache after deploying a new package to production.
Cache like..
drush cc all).I have flushed all caches
I have flushed all caches many times on the server side and I know for a fact that changed images is still showing in a few client-side browsers. When the visitor manually clears the cache in his browser (Ctrl + F5), the pages look as they should again. So I think I need a way to force peoples browsers to clear the cache on the client side.
You can force browsers to
You can force browsers to cache something, but you can't force browsers to clear their cache.
You can try and tell the browser never cache your site by pasting following code in the header (though i'm not sure if it will work?)
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien