I have some static image files that we use for our campaigns. The problem is that the marketing team changes the files very frequently and they take time to update in cloudfront cache.
Is cloudfront the best place to store such files? If yes, how do I go about handling this and make sure updated files are served.
If instead cloudfront is not the best solution then what service should I use?
Origin to cloudfront is an s3 server.
How to store frequently changing static files in Cloudfront?
514 Views Asked by Anwesh Mohapatra At
2
There are 2 best solutions below
0
Marcin
On
The recent (from August 2020) AWS blog titled Why is CloudFront serving outdated content from Amazon S3? discusses two solution:
- Invalidate the S3 objects: You can invalidate an S3 object to remove it from the CloudFront distribution's cache. After the object is removed from the cache, the next request retrieves the object directly from Amazon S3.
- Use object versioning: If you update content frequently, we recommend that you use object versioning to clear the CloudFront distribution's cache. For frequent cache refreshes, using object versioning might cost less than using invalidations.
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in AMAZON-WEB-SERVICES
- S3 integration testing
- How to get content of BLOCK types LAYOUT_TITLE, LAYOUT_SECTION_HEADER and LAYOUT_xx in Textract
- Error **net::ERR_CONNECTION_RESET** error while uploading files to AWS S3 using multipart upload and Pre-Signed URL
- Failed to connect to your instance after deploying mern app on aws ec2 instance when i try to access frontend
- AWS - Tab Schema Conversion don't show up after creating a Migration Project
- Unable to run Bash Script using AWS Custom Lambda Runtime
- Using Amazon managed Prometheus to get EC2 metrics data in Grafana
- AWS Dns record A not navigate to elb
- Connection timed out error with smtp.gmail.com
- AWS Cognito Multi-tenant Integration | Ok to use Client’s Idp?
- Elasticbeanstalk FastAPI application is intermittently not responding to https requests
- Call an External API from AWS Lambda
- Why my mail service api spring isnt working?
- export 'AWSIoTProvider' (imported as 'AWSIoTProvider') was not found in '@aws-amplify/pubsub'
- How to take first x seconds of Audio from a wav file read from AWS S3 as binary stream using Python?
Related Questions in AMAZON-CLOUDFRONT
- How to set custom Origin Name in AWS CDK for CloudFront
- Switch to Cloudfront CDN causing issues for small number of users
- How can I reconfigure CodeIgniter (v4) to serve with a new sub-directory path (via nginx)?
- Cross account origin change in lambda edge
- CloudFront Not Using SimpleCORS Policy
- Hosting multiple static sites programmatically
- Cant retrieve headers from network source type "Fetch/Redirect"
- Miss From Cloudfront: X-cache
- Custom Header from Network Request not being retrieved with fetch API
- Issues in connecting AWS Cloudfront to app hosted on AWS Elastic beanstalk
- JavaScript function not updating value after a while loop
- I am getting net::ERR_SSL_PROTOCOL_ERROR when my frontend that is running on AWS s3 bucket with cloudfront try to connect my backend on EC2 server
- Triggering lambda edge in Cloudfront origin response flow only for specific files
- Why does puppeteer timeout from lambda when calling a cloud front url?
- Use custom url with S3 uploads plugin for wordpress to AWS cloudfront
Related Questions in CDN
- CDN Detector Extension / Script
- Vite Serving Libraries without CDN
- Use Next.js project as a script tag in html file
- Serve static site on S3 + CloudFlare with Apache retaining the source URL
- Sellapp integration with React
- Is a CDN service worth it for storing images or can I use the MongoDb and my server to serve them?
- Azure CDN and caching control show TCP_MISS
- Next.jS SSG on s3bucket doesn't work on refresh
- I want to cache cloud function data in to cdn. Whatever i tried is caching in browser only
- How to get statistics about uri in azure
- Can't import PrimeVue InputOpt in CDN project
- how to reduce the website image to 2-5kb per for an ecommerce website?
- CDN for asset delivery with auth, locally run and CI support
- Can't render DataTable using Vue and PrimeVue from CDN
- How can I publish a reusable react component into CDN?
Related Questions in STATIC-CONTENT
- What qualifies as 'static content' in Next.js (Pages Router)?
- js and css are not applied to html as static files of nestjs backend solution on nginx server (localhost works correctly)
- JustPy QuasarPage - where do I put the favicon file in my project tree?
- Serve Static Content with Spring Boot 3
- Multiple retrieve-marker inside fo:static-content
- How can I run nginx on project files on windows?
- Is middleware necessary when only serving static files?
- Serve static content with webflux and multiple wildcards
- How to handle dynamic images with Next
- Ts.ED simple static server surprise 404 failure
- Best approach to serve user protected files - Node.js, Express server
- Magento 2 change static content folder
- For static domain files, cookies are still attached. How to solve? ASP.NET , IIS 10
- How to disable access to certain static files from /resources/META-INF/resources in production using Quarkus?
- Springboot statc content : None of the document roots [src/main/webapp, public, static] point to a directory
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It depends how often these files are updated and whether the other benefits of CloudFront make it worth it.
If the files are updated on average, say, once an hour or more, and you have thousands or millions of users scattered around the world, then CloudFront is still beneficial, since those users will see reduced load times due to the cache. Either use object versioning (see here) or just set a low TTL, lower than the amount of time you're happy to allow files to be out of date for - going with the updated-once-an-hour example, perhaps you could set a TTL of 15-30 minutes.
If all your users are in a similar location, then just use the S3 bucket directly in that location. You'll save on CloudFront costs and caching didn't align well with your use case anyway.
You can also use cache invalidations, but these cost extra and if you're having to do this too often then you should decrease the TTL or move off CloudFront.