builder
builder copied to clipboard
Browser cache problem with signed URLs
Description
Switching from public URLs to signed URLs causes caching issues. Browsers see different URLs each time because of parameters like expires and token, leading to re-downloads of the same file.
Workaround
In #497, we sign URLs using the current UTC day and set the expiration to 2 days. This makes URLs consistent within the same day.
Possible solutions
- Moving signing info to request headers.
- Using service workers to implement a custom caching mechanism.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#vary
只有在 Vary 中指定的 header 会和 URL 一起作为缓存的 key