Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
196 stars 9 forks source link

External Asset Cache Invalidation #1480

Open Enverex opened 3 years ago

Enverex commented 3 years ago

Currently, if Neos loads an external asset (e.g. from a http(s) source as opposed to neosrec) it appears to keep it cached indefinitely, even if the source changes. As far as I can tell, once it's been loaded into the cache, that's it, it will never check the source again to check for changes (e.g. cache expiry times or ETAG changes, etc). This means users have to manually clear their entire cache to refresh any external assets (as I can't see any way of doing this selectively either, other than original download time based).

In short; Neos needs to perform some form of external asset cache invalidation to make sure it's not holding on to ancient out-of-date copies of content. If speed is critical here, then say caching for a day regardless, then performing invalidation checks after that would be somewhat reasonable at least.

Psychpsyo commented 3 years ago

I just ran into this same issue while working on a thing that needs to load up-to-date versions of image files. (namely streamlining Cross Universe card updates) It seems like Neos completely disregards Cache-Control headers on http/s requests. A very good example for this is https://thispersondoesnotexist.com/image as that link is meant to return a different image every time it is viewed, as dictated by its Cache-Control header. But Neos will cache whatever it first got forever and never fetch a new picture, even if it should do so every time the resource is requested.

DovahDoVolom commented 2 years ago

Am also having issues regarding this and a project I am working on. Appending '?' and random characters to create a unique URL will not force it to pull a new image.