RainfallNZ / Birdle

Web app to practice bird song identification
GNU General Public License v3.0
0 stars 0 forks source link

Browser image cache can cause the wrong images to be displayed #14

Open RainfallNZ opened 8 months ago

RainfallNZ commented 8 months ago

The images should be different each day, but sometimes they show yesterdays images. Suspect this is related to local caching. Maybe stop caching of images.

RainfallNZ commented 2 weeks ago

Updating the data file so that it is loaded properly can be done several different ways, but the optimum is not obvious. See https://shiny.posit.co/r/articles/improve/scoping/ for some backgrouond on what gets loaded and when. It is possible to use a reactive file loader, but this seems to complicate everything. I have a failed example in app_reactive.r Alternatively, loading the data in the server function would probably work, but I think perhaps loads things more oftern than necessary. Using a "<<-" seems to be the best option, but whether it actually works remains to be seen.

RainfallNZ commented 1 week ago

The use of "<<-" to change the scope of the file loading didn't work.
See https://stackoverflow.com/questions/46719268/shiny-app-does-not-reflect-changes-in-update-rdata-file for some other ideas of how to fix the issue. Either use a reactive file loader, or check the file time-stamp to decide if file loading is required.