How to clear browser cache for CSS files

Every time you change external files like CSS (Cascading style sheets), you have to clear cache on the browser to see the changes. Clearing cache on application load is a a frustrating step for users. Here is a solution:
Add a questions mark and  string to the end of the UTL of the CSS fil, example "?version=xx.xx.x". On application load, the browser will think that this is a new CSS file, but when it parses it it will get the file name with out the "?flush=1". 
Caching:

<link rel="stylesheet" href="css/html_tags.css?version=xx.xx.xx" type="text/css">

NOT caching

<link rel="stylesheet" href="css/html_tags.css" type="text/css">:

Ref:


As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles