# Disable Cache for sketch.js

**URL:** <https://discourse.processing.org/t/disable-cache-for-sketch-js/13138>\
**Category:** p5.js\
**Created:** [August 2, 2019, 11:04am UTC](https://discourse.processing.org/t/disable-cache-for-sketch-js/13138 "2019-08-02T11:04:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeA](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mikeA](https://discourse.processing.org/u/mikeA)\
**Post date:** [August 2, 2019, 11:04am UTC](https://discourse.processing.org/t/disable-cache-for-sketch-js/13138/1 "2019-08-02T11:04:25Z")

</div>

Doing some development work, I am making incremental changes to the sketch.js file which is in the folder TEST on the web site [testing.com](http://testing.com) - together with the other required files such as index.html, assets etc.  
The problem is that if I browse to “[testing.com/TEST](http://testing.com/TEST)” then the old file sketch.js is executed and not its newly edited version. This is very frustrating. and the only way I can get around it is to rename the directory TESTa, TESTb etc after every edit.  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![Tiemen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tiemen/32/5477_2.png) [@Tiemen](https://discourse.processing.org/u/Tiemen)\
**Post date:** [August 2, 2019, 11:19am UTC](https://discourse.processing.org/t/disable-cache-for-sketch-js/13138/2 "2019-08-02T11:19:20Z")

</div>

If your browser cache is causing the problem you could try a [hard refresh](https://www.getfilecloud.com/blog/2015/03/tech-tip-how-to-do-hard-refresh-in-browsers/).

---

<div class="post-metadata">

**Author:** ![mikeA](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mikeA](https://discourse.processing.org/u/mikeA)\
**Post date:** [August 2, 2019, 12:06pm UTC](https://discourse.processing.org/t/disable-cache-for-sketch-js/13138/3 "2019-08-02T12:06:23Z")

</div>

Thanks very much. That did the trick. I had been trying all sorts of “no-cache” meta tags in the index.html file. A simple/effective solution - wish I had asked sooner.

---

<div class="post-metadata">

**Author:** ![mikeA](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mikeA](https://discourse.processing.org/u/mikeA)\
**Post date:** [August 2, 2019, 12:59pm UTC](https://discourse.processing.org/t/disable-cache-for-sketch-js/13138/4 "2019-08-02T12:59:11Z")

</div>

Sorry, my congratulations were premature. It worked once but not again…?  
Using Chrome on OSX: I also tried opening Developer tools and did a “Hard reload” and an “Empty Cache and hard reload”. Neither of those worked??  
Any more ideas?

---

<div class="post-metadata">

**Author:** ![mikeA](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mikeA](https://discourse.processing.org/u/mikeA)\
**Post date:** [August 2, 2019, 1:00pm UTC](https://discourse.processing.org/t/disable-cache-for-sketch-js/13138/5 "2019-08-02T13:00:52Z")

</div>

To answer my own question - a workable solution seems to be:  
In the Index.html file, add a version number parameter to the sketch.js filename thus:  
src=“sketch.js?version=3”  
You then need to increment the version number every time you edit the sketch.js file…!
