Skip to content

feat: enable manual caching for Netlify edge function that serves schemas - #2020

Merged
asyncapi-bot merged 2 commits into
asyncapi:masterfrom
smoya:feat/schemasHTTPcache
Aug 2, 2023
Merged

asyncapi-bot merged 2 commits into
asyncapi:masterfrom
smoya:feat/schemasHTTPcache

Conversation

@smoya

@smoya smoya commented Aug 2, 2023 •

Copy link
Copy Markdown
Member

Description

This PR enables HTTP cache in our Netlify edge-function that serves schema definitions on /schema-store and /definitions paths.

Here is the prove it works. Notice the 304 status code:

❯ curlie https://deploy-preview-2020--asyncapi-website.netlify.app/schema-store/2.6.0.json --header 'If-None-Match: W/"fdc1550c5681027377a9c9ba1e65bed1cbb782c6926869c6ecb1290562bc04d0"'
HTTP/2 304
cache-control: max-age=300
date: Wed, 02 Aug 2023 12:34:06 GMT
etag: W/"fdc1550c5681027377a9c9ba1e65bed1cbb782c6926869c6ecb1290562bc04d0"
expires: Wed, 02 Aug 2023 12:39:06 GMT
server: Netlify
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Authorization,Accept-Encoding,Origin,X-Bb-Conditions
x-nf-request-id: 01H6V3VEK2JF57H3HSCEXYC5GM

I'm also collecting the response status code + text and sending it to NR in all cases (not only when errors happen as previously).

cc @derberg

@netlify

netlify Bot commented Aug 2, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for asyncapi-website ready!

Name Link
🔨 Latest commit 9102291
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/64ca4ef5af04350008d02788
😎 Deploy Preview https://deploy-preview-2020--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions

github-actions Bot commented Aug 2, 2023 •

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 26
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://deploy-preview-2020--asyncapi-website.netlify.app/

@derberg derberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 🚀

@smoya

smoya commented Aug 2, 2023

Copy link
Copy Markdown
Member Author

/rtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants