Skip to content

Serve schemas with application/schema+json and cache headers #199

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
jdesrosiers opened this issue Nov 2, 2023 · 1 comment · Fixed by #200
Closed

Serve schemas with application/schema+json and cache headers #199

jdesrosiers opened this issue Nov 2, 2023 · 1 comment · Fixed by #200
Labels
✨ Enhancement Indicates that the issue suggests an improvement or new feature.

Comments

@jdesrosiers
Copy link
Member

We should be serving schemas with the proper media type and cache headers.

We've looked into this before. There was never a good solution while we were using Jekyll and Github Pages. Now that the new website is using Next.js and CloudFlare Pages, is there something between the two of those things that would allow us to solve this long-lived problem?

I imagine it could be done easily with Next.js if we had a backend, but I assume we're running as a static site. I recall that there wasn't a good solution using Cloudflare without Pages, but there might be something more at our disposal now that we're using Pages. Maybe @benjagm or @Relequestual have some knowledge about what can be done.

Example headers to cache for a year:

Content-Type: application/schema+json
Cache-Control: public, max-age=31536000, immutable
@jdesrosiers
Copy link
Member Author

This looks like what we need, https://developers.cloudflare.com/pages/platform/headers

@benjagm benjagm added the ✨ Enhancement Indicates that the issue suggests an improvement or new feature. label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Enhancement Indicates that the issue suggests an improvement or new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants