Zack, unfortunately I am not aware of any metatag
that forces cache cleanup.
however you can use hack
to force update of the file. The simplest would be to add extra information to the link to the file .js
or .css
, either by changing the name or by adding a queryString.
Let's say you have the following file .css
: \Content\style.css
, you can assume that this is version 1 of the file now, so you can link it to the page using one of the following alternatives:
<link src="\Content\style-1.0.0.css" /> <!-- é necessario renomear o arquivo -->
<link src="\Content\style.css?v=1.0.0" /> <!-- não é necessario renomear o arquivo -->
In the example above I'm passing a version, which you can change manually, but you can use other information, such as the md5
of the file or the epoch
time of the last modification.
Both epoch
and md5
can be obtained in runtime using some helper in your preferred language, in this case your link would look like this:
<link src="\Content\style.css?t=1468933059" />
<link src="\Content\style.css?h=2e9d6b2fddb91d78a0f3f07194c98e9e" />
If you have any doubts about how to automate the generation of this data, you should open a new question with a more definite scope and inform which technologies / tools you can use ( C#
, Node
, PHP
Gulp
, Grunt
, etc).
EDIT
If you really want to disable Cache, you should use the solution suggested by @CiganoMorrisonMendez (which in my opinion is the one that best answers your problem).
But remember that both the client and browser caches can greatly improve the user experience and ease the load on the server, so by keeping the cache active and using the above technique, you can take advantage of the benefits of caching and ensure users will always see the latest version of their files.