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

Use buildId to determine caching headers for a load-balanced/rolling deployment #10705

Merged
merged 8 commits into from
Apr 5, 2022

Conversation

timkelty
Copy link
Contributor

@timkelty timkelty commented Mar 7, 2022

Description

This allows us to send CP resources with cache headers, by introducing a new config setting GeneralConfig::$buildId.

When set, CP resource URLs will be generated with a buildId=xxx query param.

Only if the buildId from the request matches the config setting, or GeneralConfig::$buildId is left as null, will we serve cache headers.

A load-balanced environment should set GeneralConfig::$buildId to something unique to the deployment, such as a GIT_SHA env, or a deployment timestamp.

Related issues

@timkelty timkelty changed the title Use resourceHash to determine caching headers on a rolling deployment Use buildId to determine caching headers for a load-balanced/rolling deployment Mar 7, 2022
@timkelty
Copy link
Contributor Author

timkelty commented Mar 7, 2022

Docs note for @mattstein:

@timkelty timkelty requested a review from a team as a code owner April 5, 2022 06:06
@brandonkelly brandonkelly merged commit 09e4c15 into 4.0 Apr 5, 2022
@brandonkelly brandonkelly deleted the feature/resource-hash branch April 5, 2022 06:27
@brandonkelly
Copy link
Member

Craft 4.0.0-beta.4 is out now with this change.

@mattstein
Copy link
Contributor

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.

3 participants