Image Caching
Is your feature request related to a problem? Please describe.
When switching between notes the images within the notes are downloaded again. The sessionId and sessionToken values in the image URLs change when switching notes. I understand that this is done for increased security and session hijacking. But I have notes with 50+ not-so-small images and opening such a note takes sometimes 30 seconds until I can really use the note. The image link itself works for some time even when a new sessionId was created.
Describe the solution you'd like
Ensure that the sessionId and sessionToken values stay the same, e.g. for 5 minutes.
Thanks for reporting. I'll move this over to the text app as this is where the image URLs are generated and handled.
https://github.com/nextcloud/text/pull/7209 should help for your usability issue where the loading would block making reasonable use of your note i think, but would agree we should make the URLs cachable in some way.
Given that browser-side HTTP caches use the exact URL as cache key, I see two ways forward here:
- Get rid of the ephemeral query parameters
sessionIdandsessionTokenand think about other means to authenticate the session. Cookies or authentication headers come to my mind, but in general it doesn't feel like a good approach to change the session authentication just for attachments. - Use a service worker and normalize the cache key used there to remove ephemeral query parameters.
Given that we're thinking about a service worker for Text anyway in order to pre-cache the app assets and improve offline capabilities, I would favour this solution.