3

Possible Duplicate:
Cache busting via params

I'm using struts2jquery plugin and I wanna change a property inside jquery-ui.css which is inside a jar file called struts2jquery-plugin-3.3.1.jar.

The problem is after I changed that property I can see the value changed in the file but the browser still using the original value. When I debug the problem I figured out the browser is using a file jquery-ui.css?s2j=3.3.1 and once I remove the ?s2j=3.3.1 the browser reads the file I have changed and got the new value!

So, any one please can help me out to understand what is the difference between jquery-ui.css and jquery-ui.css?s2j=3.3.1 and how to change the value in jquery-ui.css?s2j=3.3.1 bcz I don't know where this file is.

Community
  • 1
  • 1
thinkBig
  • 823
  • 2
  • 9
  • 12
  • You'll often see this "cache-busting" technique used with underscore as the querystring key, and the current Date (in milliseconds) as the querystring value, like: `someFile.js?_=29430423420342` – jbabey Jan 30 '13 at 14:39

1 Answers1

5

It's the browser cache. When you append a querystring like ?s2j=3.3.1 to the URL, the browser considers it a new asset, still uncached, and fetches a fresh copy from the server.

It's common to see this technique being used to avoid caching on ajax requests. jQuery, for example, appends a timestamp to the URL every time you call its $.ajax function with the cache option set to false.

bfavaretto
  • 71,580
  • 16
  • 111
  • 150