0
Lately I have been very angry with Javascript, the reason is that I write my codes and functions in Javascript and they apparently don’t work. Then I need to open the browser in anonymous tab, then they work. Sometimes I need to clear the entire browser cache for the changes I made to the code to work again. There are times that even cleaning the browser cache and opening in anonymous mode the code does not work, then to see it work I need to send it on my server in a testing domain to be able to test it.
Why does this happen? Because every time I change a code in Javascript it never works first and forces me to keep doing all this gambit to make the code work?
When finally I can run a Javascript code after clearing the cache or use in anonymous tab, it remains working for a long time, but according to what I give refresh on the page (to test changes) it stops working again. This worries me, because and if this happens to the user who accesses my site and functions stop working according to the number of hits that it makes on the site?
I declare all scripts at the end of the code before closing body
.
The cache issue is not gambiarra, it is the natural behavior of the browser that will help you a lot in production environment. To get around it, you can read Force javascript file update without disabling cache. Now, to know why it stops working after a few hits, you’ll need to post the codes here.
– Woss