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 answers
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
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in AMAZON-WEB-SERVICES
- "Access Denied" - User's Permissions to S3 Bucket
- Cohort analysis with Amazon Redshift / PostgreSQL
- Using Amazon KMS service on Heroku
- can't ssh in after cloning an EC2 instance on Amazon AWS
- Using HDFS with Apache Spark on Amazon EC2
- How can I access Mule ESB Community edition via browser?
- AWS EC2: Migrating from Windows to Linux Server
- AWS ELB Load Balancer: is it possible to set multiple session cookies?
- AWS Flow Framework: Can we run activity worker and activity task on different EC2 instances
- Unable to access files from public s3 bucket with boto
- Cloudfront stream only part of the video
- s3cmd not working as cron-task when echos/dates are added
- How to deploy django 1.8 on Elastic Beanstalk using Docker
- InstanceProfile is required for creating cluster - create python function to install module
- How to fix WordPress HTTPS issues when behind an Amazon Load Balancer?
Related Questions in AMAZON-CLOUDFRONT
- Cloudfront stream only part of the video
- loadHTTPProvider error on wowza
- How to get Cloudfront subdomain from the request on the custom origin?
- Proxy request path in AWS for Single Page App
- Amazon S3 Redirect Rule - Preserve Query Params
- Storing user submitted images
- AWS CloudFront: Content not immediately available
- "You need to give a SHA parameter" error when serving Dragonfly images through Cloudfront
- Getting Foundation Icons to display in Rails 4 / Cloudfront Environment
- Angular and cloudfront with Safari
- Can I add a TXT record to Cloudfront?
- Moving wp-content folder to Amazon S3/CloudFront?
- Leverage browser caching issue with already cached content
- Serving Images uploaded to S3 via CloudFront
- I am not able to sent email in wordpress website using cloud amazon hosting
Related Questions in CDN
- What happen when user location is near the Origin server more than CDN server?
- Track how many of our visitors that use a CDN?
- Change assets urls to cdn adding absolute path in Grunt
- Does CDN know which website the client is visiting when fetching jquery.min.js or other resource from CDN?
- CDN and Server Architecture : Picture upload feature for my web app
- Redirect image requests from locations on origin domain to CDN domain
- Not able to serve different robots.txt for CDN77
- ASP.NET MVC multiple virtualpath Bundle with CDN
- $_SESSION failing when calling PHP file through a CDN
- What is the cause of website waiting times?
- How to add CDN with Aurelia-CLI and RequireJS
- Is there a CDN service in Bluemix?
- CDN with fallback in Symfony twig using assetic
- Jquery Google CDN not recognised when loaded?
- How to use github repo as like CDN server for uploading assets file?
Related Questions in STATIC-CONTENT
- nginx - serve content from inside a zip (jar) archive
- Is there any advantage in storing static html files in a server variable on a node-express server?
- Wildfly Swarm JAXRSArchive add webapp directory
- Why are Content, Scripts served as static and other directories not?
- Serving static files through MongoDB's GridFS
- How to serve static content from a controller in Rails?
- Does application size matters when storing static content?
- where put images files in big multimodules web app
- Best lightweight web server (only static content) for Windows
- Fetch Static files from Server in Django
- How to store frequently changing static files in Cloudfront?
- How to host static content from Jboss EAP 7.1 slave in HA cluster?
- IIS stopped serving static content over a certain (small) size
- Changing static files directory in MVC3 causes 404
- HTTP 404: The /Media directory is not serving images
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?
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)
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.