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

Include Cache-Control Headers #1

Closed
kespinola opened this issue Mar 22, 2022 · 1 comment
Closed

Include Cache-Control Headers #1

kespinola opened this issue Mar 22, 2022 · 1 comment
Assignees

Comments

@kespinola
Copy link
Contributor

Background

When the service being proxied by cloudflare sets Cache-Control header cloudflare will forward the header along to the browser which triggers it to lookup the context from its local cache instead of requesting from cloudflare.
Screen Shot 2022-03-22 at 6 27 43 AM

Goal

Users that have viewed an image before from their browser serve images from local cache instead of requesting again from cloudflare.

Requirements

When image successfully resized set Cache-Control header max-age to trigger local cache lookups from a browser.

https://github.com/holaplex/holaplex/blob/dev/pages/api/arweave/txt/%5Bid%5D.ts#L45

@mpwsh mpwsh self-assigned this Mar 22, 2022
@mpwsh
Copy link
Member

mpwsh commented Mar 22, 2022

Added Cache Control headers to each response after image has been download/resized.

See PR #2

I can see images being cached by the browser.

@mpwsh mpwsh closed this as completed Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants