Image caching breaks sketches in production
Nature of issue?
- Found a bug
Details about the bug:
When uploading a file, it is immediately available when using loadImage with the file name explicitly typed as the argument.
Additionally if you use a variable where the file name is explicitly set as the variable, loadImage works immediately after upload.
BUT: if you “build” the variable ie file=‘files/upload’ + i + ‘.jpeg’; loadImage says the file does not exist. Yet, if you wait ~3 minutes without changing anything it will work.
I don’t know if this is preventable, but I though it was odd that I can immediately access the file explicitly, but when using a built variable as shown above, it doesn’t work for ~3 minutes. I couldn’t find any documentation about file availability after upload.
- Web browser and version: Safari
- Operating System: IPad Pro: IOS 14.3
- Steps to reproduce this bug:
-
- Upload an image file.
-
- loadImage using explicit file path/name as argument
-
- loadImage using variable with explicit file path as argument
-
- loadImage using variable with “built” file path as argument (does not work);

I have a feeling this is the same issue as #1591 as I'm not able to reproduce on development, but on the production server I am. I think the solution is to serve these through a different server (#166) that doesn't use the same caching.