Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache images and CSS in the node server #1098

Open
dessalines opened this issue Jun 6, 2023 · 3 comments
Open

Cache images and CSS in the node server #1098

dessalines opened this issue Jun 6, 2023 · 3 comments
Labels

Comments

@dessalines
Copy link
Member

I'd thought we'd had this, but I guess not.

@miyurusankalpa would you be able to help with this one?

Context LemmyNet/lemmy-ansible#75

@Nutomic
Copy link
Member

Nutomic commented Jun 6, 2023

For this it would be really helpful if lemmy and lemmy-ui can set proper cache-control headers. Like setting private when its an authenticated user, and in case of static assets it can set etag.

@dessalines
Copy link
Member Author

In that case I'll transfer this to lemmy-ui, since its embedded node server should do that caching.

@dessalines dessalines transferred this issue from LemmyNet/lemmy-ansible Jun 6, 2023
@dessalines dessalines changed the title Cache images and CSS in nginx. Cache images and CSS in the node server Jun 6, 2023
@Nutomic
Copy link
Member

Nutomic commented Jun 6, 2023

It doesnt need to do any caching on its own, just set the correct HTTP headers. Then admins can configure caching in nginx or another reverse proxy based on their requirements. Browsers also do caching based on these headers.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants