
I need the htaccess code to clear cache on client side
- or -
Post a project like this1698
$10
- Posted:
- Proposals: 2
- Remote
- #2947677
- Awarded
Description
Experience Level: Entry
How do you force a website to automatically clear the cache files so that when the website is updated with new pics/ css, the new version is uploaded?
I know caching helps speed up the site when the user is browsing, so I'd like to keep that feature, but only for the latest updates.
I was told I need to insert directions in the htaccess files. If so, what is the code?
so, two parts to the code:
-website loads with the latest updates ( does not use cache stored on computer)
-website caches the new updates for use
-BUT if there are any future updates, then the website again loads with instructions to clear the latest cache.
for example, I used this:
ExpiresActive Off
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
but it didn't work! website on my computer still is using cache files from previous version. So it must be a different code.
I am hosting with www.50webs.com
Thanks.
I know caching helps speed up the site when the user is browsing, so I'd like to keep that feature, but only for the latest updates.
I was told I need to insert directions in the htaccess files. If so, what is the code?
so, two parts to the code:
-website loads with the latest updates ( does not use cache stored on computer)
-website caches the new updates for use
-BUT if there are any future updates, then the website again loads with instructions to clear the latest cache.
for example, I used this:
ExpiresActive Off
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
but it didn't work! website on my computer still is using cache files from previous version. So it must be a different code.
I am hosting with www.50webs.com
Thanks.

Allang N.
100% (3)Projects Completed
3
Freelancers worked with
3
Projects awarded
38%
Last project
5 Aug 2020
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Hi there , in which cms its working ? the things you are asking for is You can't force browsers to clear their cache But will you use alternative way if we suggest ?
Allang N.04 Aug 2020Hi, what alternative way is there?Just to clarify I'd like for people viewing the site to not have to manually clear cache. I'm not using any cms. It's a static site
-
Is this a WordPress website?
Allang N.04 Aug 2020no. static site
-
Have you tried clearing your browser cache?
Allang N.04 Aug 2020Yes, I know that will work, but I want to set it so that others don't have to manually clear their cache to see updated version.
937155937154937146
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies