Hi JATOS team and users,
We've been struggling with image caching problems on older versions of MacOS/iOS (prior to BigSur/14.1). I initially thought this was a JavaScript issue, but after lots of investigating, I now think it's related to our server's HTTP response settings.
We set up our experiments so that any image (or other media files) are preloaded at the start of the experiment. The problem is that, on some MacOS/iOS devices, the files are requested again over the network every time they're needed during the experiment, instead of loading from the browser cache. Here's an example of our image headers:
I think the problem might be that there's no max-age/Expires or ETag values in the response header. I'm not sure what the defaults are, but maybe when these are missing, it's up to the browser to decide whether the file is cache-able or needs to be requested again every time? We tried loading the files from a different server and found that this can solve the problem on the exact same OS/browser. Here's an example of the response header for an image that is loaded from a different server - in this case, the multiple-request problem doesn't occur.
So I think I need to change our server's Cache-Control setting for media files to something like "public, max-age=31536000", and maybe add an ETag and/or Last-Modified? If so, I'm not sure how to do this. I wonder if anyone who is using JATOS with Nginx could share their cache-related config settings with me?
Thanks!
Becky