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

feat(frontend): HTTP cache-control for assets (css, png, webp etc.) #2646

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Oct 4, 2024

Motivation

I propose to start caching on the client side the assets that are generated from the $lib/assets directory. The assets are generated with a hash name.

For example: https://oisy.com/_app/immutable/assets/cover-features.BNqeslTw.png

Notes

Given that assets are hashed, I think we can try to use a long living cache - i.e. a year.

Changes

  • Define a Cache-Control header for _app/immutable/assets

Copy link
Contributor

@AntonioVentilii-DFINITY AntonioVentilii-DFINITY left a comment

Choose a reason for hiding this comment

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

LGTM!

@peterpeterparker peterpeterparker merged commit 670a303 into main Oct 4, 2024
11 checks passed
@peterpeterparker peterpeterparker deleted the feat/cache-css-images branch October 4, 2024 06:59
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

Successfully merging this pull request may close these issues.

2 participants