1

Having this page Page, I can't seem to find a way to really disable the cache on all sides (server & client) .

What i tryed : disabled the network http cache on firefox from about:config(even cleared cache manually) ; added a timestamp in query string in the css url css/style.css?<?php echo time(); ?> ;

As you can see the style.css is empty but no changes are made to the page (unless i remove link tag , the css request) . I think apache cached the file and it's sending the cached version . How can i tell apache , via htaccess , not to send the cached version of the file and allways send it from the actual source path ?

P.S. : I'm working with a remote server .

1 Answer 1

1

Apache, in general, will not cache any content, unless you use mod_proxy_cache or similar.

Your caching is probably happening somewhere else. A few things to try:

  • see if you are using a proxy server, this can cache content sometimes
  • doing CTRL+SHIFT+R or CTRL+F5 usually forces the browser to refetch the content even if they already have the file in local cache
  • use Chrome's Network inspector or Firebug and check exactly which version of the file is being served and if the browser is sending the "If-Modified-Since" header and/or the server is sending the "Expires" header

You can also try setting the Expires directive in the Apache config, to force proxies/browsers to not keep stale copies of the file (https://httpd.apache.org/docs/2.2/mod/mod_expires.html).

If nothing else works, try renaming the file and see if it works. If it doesn't, your problem is somewhere else.

Sign up to request clarification or add additional context in comments.

2 Comments

I renamed the file and changes are visible . Where is the cache being made in your opinion ? what apache directives should i use ?
Either browser or proxy. You might have a transparent proxy installed where you are located. Check with Firebug or Chrome inspector.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.