You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a single bug. Do not report multiple bugs in one issue.
It's a frontend issue, not a backend issue; Otherwise please create an issue on the backend repo instead.
Summary
I noticed that error pages like 404 currently can be cached if they match the patterns for caching logic, up to a day depending on the URL.
This can especially be a problem when running multiple Lemmy-UI containers and doing a rolling upgrade where some containers may still be using the old version and others are already on the new version, as a user might get the main page served from an updated container but the request for loading static assets like CSS files is routed to an old container, which doesn't know about the path.
Requirements
Summary
I noticed that error pages like 404 currently can be cached if they match the patterns for caching logic, up to a day depending on the URL.
This can especially be a problem when running multiple Lemmy-UI containers and doing a rolling upgrade where some containers may still be using the old version and others are already on the new version, as a user might get the main page served from an updated container but the request for loading static assets like CSS files is routed to an old container, which doesn't know about the path.
Steps to Reproduce
Technical Details
The
cache-control
header is currently added with no consideration of the response being a success response:https://github.com/LemmyNet/lemmy-ui/blob/main/src/server/middleware.ts#L46-L63
It might be possible to defer setting the header to the end of the response via
res.end
and then evaluating the status code: https://stackoverflow.com/questions/41009876/get-status-code-in-express-middlewareLemmy Instance Version
0.19.11
Lemmy Instance URL
No response
The text was updated successfully, but these errors were encountered: