"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!
Add a string at the end of your URL to break the cache. I usually do (with PHP): script src="/my/js/file. Js?".
Add a string at the end of your URL to break the cache. I usually do (with PHP): So that it reloads every time while I'm working on it, and then take it off when it goes into production. In reality I abstract this out a little more but the idea remains the same.
If you check out the source of this website, they append the revision number at the end of the URL in a similar fashion to force the changes upon us whenever they update the javascript files.
Good option, only it means that browsers will never cache the file meaning you "lose the performance gains when just browsing the net". – Alconja May 15 '09 at 1:23 You lose the performance gains when "just browsing the website you're currently working on" more like. – Paolo Bergantino May 15 '09 at 1:25 Ok, I assumed you meant to go live with this.(remember that end users will have cache issues as well, so its not a bad idea to make sure that when you .
Js files change the user's browser somehow knows to get the latest version too). – Alconja May 15 '09 at 1:39 What do you do to have it fixed in production so it is not reloaded every time? Changing all the related pages when the javascript file is updated.
Without committing any unneeded change to the pages in the repository. – Eduardo May 15 '09 at 21:14 As @Paolo suggested above, just append the revision number to the end of the URL.Somescript. Js?
R=2011.07.24 or whatever. You could also append an encoded version of the last modified date. This allows the browser to only cache the latest version of your script.
When the script is updated, the URL changes, so the browser fetches the file again. – BMiner May 15 '09 at 13:12.
Paolo's general idea (i.e. Effectively changing some part of the request uri) is your best bet. However, I'd suggest using a more static value such as a version number that you update when you have changed your script file so that you can still get the performance gains of caching.So either something like this: or maybe I prefer the first option because it means you can maintain the one file instead of having to constantly rename it (which for example maintains consistent version history in your source control).
Of course either one (as I've described them) would involve updating your include statements each time, so you may want to come up with a dynamic way of doing it, such as replacing a fixed value with a dynamic one every time you deploy (using Ant or whatever).
– BrianK May 9 at 14:21 @BrianK - should be fine. – Alconja May 10 at 0:55 I am going to take this idea and try in my page load event (in . Net) to create a version number based on the date time (kind of a mixture of both you and Paolo's idea) because this is becoming a real headache.
Not necessarily for me personally but when I update the JS to our testers, they forget to CTRL F5 and then send back bugs after they have been fixed... (just need to make sure I take this out before production! ) – toddv Nov 1 at 15:38 THIS WORKS LIKE A CHARM: String jsDateTime = DateTime.Now.ToString(). Replace(" ", "").
Replace("/", ""). Replace(":", ""); LiteralControl jsMain = new LiteralControl(); jsMain. Text = ""; Page.Header.Controls.
Add(jsMain); – toddv Nov 1 at 16:26.
In javascript I think that it is not possible, because modern browsers have a policy on security in javascripts.. and clearing the cache is a very violating one. You can try to add In your header, but you will have performance loss.
When you work with web page or javascript file you want it to be reloaded every time you change it. You can change settings in IE 8 so the browser will never cache. Follow this simple steps.
Select Tools-> Internet Options. In General tab click on Settings button in Browsing history section. Click on "Every time I visit the webpage" radio button.
Click OK button.
2 That doesn't do what you think it does. See enhanceie.com/redir/?id=httpperf for a discussion of each of the settings. – EricLaw -MSFT- Aug 16 '09 at 0:37 I did this but still have to refresh page or press F5?
– charlie_cat Jul 25 at 14:17.
To eliminate the need to repeatedly press F5 in an IE tab while developing a website, use ReloadIt. For each webpage displayed in IE, you can configure a filename, a directory, or a set of them. If any change occurs in any of those configured paths, ReloadIt refreshes the IE tab.
A simple tool. It just works. This will reload everything, not just javascript.
I found this way much better and faster: Simply press and hold your CTRL key whilst you press the refresh button (or press CTRL-F5 whilst browser is focussed).
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.