Zack, unfortunately I’m not aware of any metatag
that forces the cache clean.
but you can use a hack
to force the file update. The simplest would be to add extra information to the link to the file .js
or .css
, either changing the name or adding a queryString.
Let’s say you have the following file .css
: \Content\style.css
, you can assume that from now on this is version 1 of the file, 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 am passing a version, which you can change manually, however you can use other information, as the md5
of the archive or the epoch
team of the last modification.
Both the epoch
as to the md5
can be obtained in Runtime using some helper in your preferred language, in which case your link would look like this:
<link src="\Content\style.css?t=1468933059" />
<link src="\Content\style.css?h=2e9d6b2fddb91d78a0f3f07194c98e9e" />
remembering that if you have any doubts about how to automate the generation of this data, you should open a new question with a more defined 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 (browser) and server cache can greatly improve the user experience and ease the load to the server, so by keeping the cache active and using the above technique, you will be able to take advantage of the benefits of caching and ensure that users will always see the latest version of their files.
Only by clearing the browser cache: http://stackoverflow.com/questions/20300400/google-chrome-css-doesnt-update-unless-clear-cache
– Diego