Easiest method for expiring the css and js headers

Ads

 
 

Share on Google+Share on Google+

Java Coder
Easiest method for expiring the css and js headers
1 Answer(s)      3 years and 11 months ago
Posted in : HTML

Hi,

I have a website with many thousand users visiting per day. I have changes the css file and uploaded it on server. Now some user is getting the old css file. Let's know what could be the easiest method to solve the browser cache issue?

There is not way to tell the users of my site to clear the cache. I need some smart solution.

Thanks

Ads
View Answers

October 2, 2013 at 3:30 PM


Hi,

The easiest way is to add the parameter to the css file. Here is example:

Old code:

<link href="/css/my.css"  type="text/css"/>

Modified code:

<link href="/css/my.css?v=1"  type="text/css"/>

Please note down that we have added ?v=1 after the css file name.

Hope above trick will help you.

Thanks


Ads









Related Tutorials/Questions & Answers:
Easiest method for expiring the css and js headers
Easiest method for expiring the css and js headers  Hi, I have a website with many thousand users visiting per day. I have changes the css file... what could be the easiest method to solve the browser cache issue
Input / Output in Easiest Method in Java
Input / Output in Easiest Method in Java  How to input from keyboard, both strings and characters and display the result on the screen with the easiest method in Java?   Hi Friend, Try the following code: import
Advertisements
CSS
style sheet validates at Note that some warnings may be unavoidable, but your CSS
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?  How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js? I set
CSS in flex
the StyleManager.loadStyleDeclarations() method in your Flex application. This method loads the CSS-based...CSS in flex  Hi....... Please tell me How can I load CSS style... dynamically loading of CSS file is not supported in flex. you can compile
What is Headers and Mime Types ?
What is Headers and Mime Types ?  Headers and Mime Types   Actually PHP‚??s header() is used to send a raw HTTP header. header() must...-headers-and-mime-types
Request Headers In EL
Request Headers In EL      ..., it also sends the headers with it. All the headers are optional except Content... commonly used headers are: 1) Accept : The MIME types the browser prefers. 2
Working with CSS(CSS Manipulation)
CSS-related properties of elements. .css( ) This method get the CSS... Working with CSS(CSS Manipulation)       Working with CSS(CSS Manipulation
HTML CSS
HTML CSS  Explain in brief about the term CSS
Specific Request Headers in JSP
Specific Request Headers in JSP     ..., it can also sends the headers with it. All the headers are optional except... commonly used headers are: 1) Accept : The MIME types the browser prefers. 2
CSS Apply
CSS Apply  How can I apply different CSS to my application for background by taking CSS list in Select tag i.e. Combo box. for e.g As in Orkut we select theme & by clicking to apply it changes background theme & color
jtable with table headers - Swing AWT
jtable with table headers  give me java code to create jtable with table headers and by which i can scroll jtable and can retrieve height and width of the table
CSS in Flex
CSS in Flex  Hi...... Please tell me How do you use css styles in flex? Thanks  Ans: @namespace s "library://ns.adobe.com/flex/spark"; @namespace mx "library://ns.adobe.com/flex/mx"; .button{ font
css
css
css
Easiest way to learn Java
There are various ways to learn Java language but the easiest way to learn Java is online. RoseIndia provides Java courses online that helps beginners to learn the language from the comforts of their home. Every topic and chapter
Java Servlet : Http Request Headers
a request via GET or POST method usually. It can also send a number of headers...Java Servlet : Http Request Headers In this tutorial, you will learn how to Http Request Headers works in java servlet. Http Request Headers : HTTP
Version of com.mattunderscore>structured-http-headers dependency
List of Version of com.mattunderscore>structured-http-headers dependency
Version of com.mattunderscore>structured-http-headers dependency
List of Version of com.mattunderscore>structured-http-headers dependency
Java Servlet : Http Response Headers
Java Servlet : Http Response Headers In this tutorial, you will learn how to Http Response Headers works in java servlet. Http Response Headers : Web server sends response with one or more response headers including the document
What are the advantages and disadvantages of CSS?
What are the advantages and disadvantages of CSS?  What are the advantages and disadvantages of CSS
Java get Http Headers
Java get Http Headers     ... the Http Headers. Here, we are using the URL class which points the resource... used the class URLConnection. url.openConnection()-  This method of URL
Request Headers in JSP
Request Headers in JSP      ... the request in the form of get or post method or any other HttpRequest  methhods. It can also sends the headers with it. All the headers are optional
parser jquery css
parser jquery css  How to parser jquery in css
Retrieve HTTP Request Headers using JSP
Retrieve HTTP Request Headers using JSP   ... the request headers. When a HTTP client sends a request, it is required to supply GET or POST. It can send a number of headers. Here are some headers:    
HTML CSS example
HTML CSS example  Hi, Can anyone share the HTML CSS example code. I my HTML web page I have to embed the CSS style. Share some HTML CSS example with me. Thanks   Hi, You can use the following code to define CSS
Include CSS in HTML
Include CSS in HTML  Can any one tell me how to include a CSS file into my HTML page. A code format to include the CSS will work. Thanks in Advance.   Include CSS in HTML To include a CSS or Style Sheet into you HTML
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
jQuery CSS Selector
jQuery CSS Selector       jQuery CSS Selector In this section we are learning about the jQuery CSS Selector. The CSS Selectors is the powerful API provided
CSS Designer
CSS Designer         CSS Designer is now availabe as part of the Web Designer. JointLogic CSS Designer is an Eclipse plugin that provides CSS authoring facilities