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

On demand Cloudfront Cache Invalidation #3967

Open
3 tasks done
antonioMerkulov opened this issue Nov 12, 2024 · 4 comments
Open
3 tasks done

On demand Cloudfront Cache Invalidation #3967

antonioMerkulov opened this issue Nov 12, 2024 · 4 comments
Labels
feature-request New feature or request

Comments

@antonioMerkulov
Copy link

Before opening, please confirm:

Amplify Hosting feature

Build settings, Frontend builds

Is your feature request related to a problem? Please describe:

In an AWS Amplify Generation 2 environment, Amplify uses CloudFront under the hood for content delivery. There is an option within Amplify called "Keep cookies in cache key" which the development team has disabled.

The primary reason for disabling this option is that on every page load, cookies like Google Tag Manager (GTM) and Datadog generate different values. Including these cookies in the cache key would prevent effective caching, as CloudFront would treat each unique cookie value as a separate cache entry.

When a new build is generated in Amplify, CloudFront's cache is automatically invalidated, ensuring that users receive the most recent content. However, when content is updated within the Content Management System (CMS), there is no mechanism to invalidate the CloudFront cache without running a new build. This limitation exists because Amplify Generation 2 does not provide direct access to the underlying CloudFront distribution, making it impossible to programmatically invalidate the cache in response to CMS changes.

Describe how you'd like this feature to work

Is it possible within AWS Amplify Generation 2 to specify specific cookie names to include in the CloudFront cache key, similar to native CloudFront configurations?

Are there alternative methods to invalidate the CloudFront cache upon CMS content changes without initiating a new build?

What best practices can be employed to manage cache invalidation in this scenario to balance performance and content freshness?

@antonioMerkulov antonioMerkulov added the feature-request New feature or request label Nov 12, 2024
Copy link

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

@jagmitg
Copy link

jagmitg commented Nov 15, 2024

i would very interested and keen on this! Really dont want to deploy every single time we make any content change.

@assajak
Copy link

assajak commented Nov 15, 2024

I have the same problem, content was updated but i have to wait time to see result.

@MyNameIsTakenOMG
Copy link

Agree, having access to the underlying cloudfront distro can be very helpful in some situations, including this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants