Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Investigate cache headers for Next.js content #312

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

Closed
jawnsy opened this issue Feb 17, 2022 · 3 comments
Closed

Investigate cache headers for Next.js content #312

jawnsy opened this issue Feb 17, 2022 · 3 comments
Labels
site Area: frontend dashboard
Milestone

Comments

@jawnsy
Copy link
Contributor

jawnsy commented Feb 17, 2022

For the static content that we render, we should determine appropriate cache headers to return and make sure we're returning them, so that caching reverse proxies and CDNs can reduce load on Coder.

Many systems are designed to be content-addressable, so that generated files can be cached indefinitely, with only an index page needing to be served without caching (or with caching but requiring revalidation with an ETag or timestamp).

We would likely need to investigate how next export content should be served when added to an S3 or GCS bucket (i.e. what headers are added), and replicate those in our server.

@jawnsy
Copy link
Contributor Author

jawnsy commented Feb 17, 2022

Next documents the headers it normally adds, anything under the _next/static path can have the following header attached:

Caching improves response times and reduces the number of requests to external services. Next.js automatically adds caching headers to immutable assets served from /_next/static including JavaScript, CSS, static images, and other media.

Cache-Control: public, max-age=31536000, immutable

https://nextjs.org/docs/going-to-production#caching

@bryphe-coder
Copy link
Contributor

Looks like this is fixed by #330 🎉

@jawnsy
Copy link
Contributor Author

jawnsy commented Feb 19, 2022

Yup, forgot to tag it!

@jawnsy jawnsy closed this as completed Feb 19, 2022
@misskniss misskniss added this to the V2 Alpha milestone May 3, 2022
@misskniss misskniss added the site Area: frontend dashboard label Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site Area: frontend dashboard
Projects
None yet
Development

No branches or pull requests

3 participants