p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

images loaded in preload persist despite clearing browser cache after being swapped

Open enauman opened this issue 3 years ago • 3 comments

Nature of issue?

  • Found a bug

Details about the bug:

  • Web browser and version: Chrome: 90.0.4430.93, Safari: 14.1
  • Operating System: MacOS 10.15.7
  • Steps to reproduce this bug: After replacing an image I'm still getting the old one after clearing my cache. Here are the details of what I'm doing: I am preloading images from an images folder using prefix and extension variables, in a loop:
var PRE1 = 'images/legs';
var PRE2 = 'images/body';
var PRE3 = 'images/head';
var EXT = '.jpg';
function preload(){
  for(var i=0;i<legs.length;i++) {
    legs[i] = loadImage(PRE1 + i + EXT);
    body[i] = loadImage(PRE2 + i + EXT);
    head[i] = loadImage(PRE3 + i + EXT);
  }
}

Images are numbered legs0.jpg, legs1.jpg, legs2.jpg, etc. If I replace an image with a new one, deleting the old and uploading the new, I can't get the old cached one to stop showing up after clearing my browser cache and history. What is weirdest is the old image still shows up in Incognito, and opening the fullscreen URL in Safari when I had not even opened the app in Safari before, so it couldn't have been cached in that browser. The only way to make the new image show up is to duplicate the whole project.

enauman avatar May 10 '21 00:05 enauman

Thanks for reporting! It seems like maybe the file names are getting mapped to stale URLs and not saved. This warrants further investigation to figure out the underlying issue.

catarak avatar Jun 11 '21 19:06 catarak

A further note, after a couple days I noticed the images did update.

enauman avatar Jun 16 '21 11:06 enauman

I think this is the same issue as #1738 and maybe we should close this to keep tracking in one place? Let me know if I'm missing something subtle in the description here. Thanks!

kjhollen avatar Nov 12 '21 18:11 kjhollen

Seems similar to https://github.com/processing/p5.js-web-editor/issues/1738 to me as well! Closing this issue here :)

raclim avatar Jan 23 '23 03:01 raclim