JavaScript to work and only come back with empty cache? [closed]

0

Lately I've been very angry with JavaScript, the reason being that I write my codes and functions in JavaScript and they do not seem to 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 in my code to work again. There are times that even cleaning the browser's cache and opening it in anonymous mode the code does not work, then to see it work I need to send it to 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 have to do all this gambiarra to make the code work?

When finally I can run a code in JavaScript after clearing the cache or using anonymous tab, it stays on for a long time, but according to what I'm giving refresh on the page test changes) it stops working again. This worries me, so what if this happens to the user who accesses my site and the functions stop working according to the number of hits he makes on the site?

I declare all scripts at the end of the code before closing body .

    
asked by anonymous 03.02.2017 / 22:30

2 answers

1

Browser caching is just to optimize a web application, taking advantage of page content so that you do not need to reload some features every time the page refreshes. What I suggest for the development environment would be the use of the Chrome browser. Press F12 to open the Code Watch window, click the 3 dots at the top of the window, and then click Settings to open the settings. Check the Disable cache (while DevTools is open) option as in the image below:

And whenever you're developing and testing your code, leave the Code Watch window open.

    
04.02.2017 / 04:02
-3

The logical solution is the cache you made on the first load as you should know by now. This explains why an update in the code does not run first. I press 5 or 6 times F5 to update the cache. And so I see my update working.

    
03.02.2017 / 23:19