Skip to content
Home » Blog » How to add no-cache for CSS

How to add no-cache for CSS

There are many possible way to add no cache to a CSS. Before seeing the method I want to tell you why we need to write no cache to CSS. When there is an updated in CSS then you find the the right class and ID and update the code with minor or major change. Once the change is applied you upload the CSS file to right place and refresh your website to see the change. Unfortunately if you are using Google Chorme/IE then you will have hard time to see the changed effect.

You will almost break your refresh button, this will be lot more frustrating. Even worst when you deliver it to your client. The client machine will be a cache storage, they will not realize that you have did something in their website. You have to instruct them how to do a force refresh. To solve this problem one can follow one of this two method.

Method 1:
Adding current time stamp with microseconds to your CSS and JS file name so your file will look like
{code type=PHP}

Like this:

Leave a Reply

Your email address will not be published. Required fields are marked *