0

I have tried researching to clear cache of my website from meta tag. But none of them are working.

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate, max-age=0" />
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Expires" content="Tue, 01 Jan 2000 00:00:00 GMT">

tried this one, but I am getting cache in firefox.

To see cache: Type about:cache or about:cache?storage=disk&context= in address bar.

I tried the below one, its working, but I need to do this programatically.

Enter "about:config" into the Firefox address bar and set:

  network.http.use-cache = false

Any working solutions in meta tag or Javascript or HTML5 manifest will be highly appreciated.

UI_Dev
  • 3,317
  • 16
  • 46
  • 92
  • 1
    http://stackoverflow.com/a/13291751/1675954 – Rachel Gallen Jul 29 '15 at 10:52
  • what you are asking is against the "sandbox" principle of todays modern browser. Simply, you cant speak to the browser to do stuff outside of it. if this would work, hackers would have a blast. – Mark Jul 29 '15 at 12:24

1 Answers1

1

meta tag

No. The http-equiv attribute supports a number of values, none of which touch caching.

Javascript

No. JavaScript is not provided with any APIs that let you override caching.

HTML5 manifest

No. The manifest lets you mark files to be hard cached for offline use. It provides no mechanism to reducing caching.


If you want to tell the browser not to cache something then you have to do it with real HTTP headers.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • How can I use real HTTP headers? Any links you have gone through? – UI_Dev Jul 29 '15 at 11:33
  • By configuring your HTTP server (which depends on which server you are using) or generating your page using a server side program (which depends on which programming language you are writing it in). – Quentin Jul 29 '15 at 11:45
  • I m not getting you @Quentin – UI_Dev Jul 29 '15 at 11:48
  • What don't you understand? – Quentin Jul 29 '15 at 11:48
  • I m using Java for backend, html codes for frontend, I dont understand what you are saying about "generating your page using server side program" – UI_Dev Jul 29 '15 at 11:50
  • It sounds like you are already using a server side program and you have written it in Java. Read up on how to set HTTP headers in whatever variant of Java (J2EE?) you are using. – Quentin Jul 29 '15 at 11:51