Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear cache on code changes

Status
Not open for further replies.

Denster

Programmer
Apr 9, 2001
198
GB
What is considered the norm when changing javascript/jquery code on a live site? Obviously the changes wont be noticable to previous visitors until they clear their cache. Iv had big problems in the past where entire pages have crashed becuase Im inserting markup in the code behind, but the javascript is still using the old code.
 
Hi

Sounds like you need to add version numbers. Either of these :
Code:
[gray]<!-- included in the file name -->[/gray]
[b]<script[/b] [maroon]src[/maroon][teal]=[/teal][green][i]"yourscript-1.2.3.js"[/i][/green][b]></script>[/b]

[gray]<!-- just appended to manipulate caching -->[/gray]
[b]<script[/b] [maroon]src[/maroon][teal]=[/teal][green][i]"yourscript.js?1.2.3"[/i][/green][b]></script>[/b]
If I misunderstood your requirement, please clarify.


Feherke.
 
Ah yes - never thought of that. Suppose thats why the jquery core files have the version number at the end. I do have some javasript at the top of the actual page but looks like I need to strip this out and keep it separate. Thanks for the solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top