Updating files on CloudFront
Table of Contents
Intro
Invalidating objects removes them from CloudFront edge caches.
All your files stored on CloudFront are cached allowing them to be served as fast as possible. What if you want to update a file or image that you have stored there? You can update as many files as you like but it can take up to 24 hours for the changes to catch up.
Scenario
I use CloudFront to store the update files for my extensions and I can't version their names because they would stop working. To get around this every time I release a new version I manually invalidate the extensions update xml file using the follow procedure.
Guide
Step 1
First make sure you are logged into AWS and then select the Console Home icon from the top left. [Figure 1]
Step 2
Now select CloudFront from the list of services. [Figure 2]
Step 3
In the next window make sure you have Distributions selected from the top left. [Figure 3]
Step 4
Next click the link for the associated distribution from the list (under id). [Figure 4]
Step 5
Select the Invalidations tab. [Figure 5]
Step 6
Click the Create Invalidation button and then enter the location of the file/s you want to be invalidated. [Figure 6]
For example:
Step 7
Then click the Invalidate button and you should now see InProgress under status. [Figure 7]
It usually takes 10 to 15 minutes to complete your invalidation request, depending on it's size..
Finished
Once it says completed you are good to go.
Tips
Copy previous invalidation
Once you have created a few invalidations if you come back and need to invalidate the same files try this. Click the select box for the item you want to duplicate, once you have done this the Copy button at the top will become available. Click the Copy button make any needed changes and you are done. [Figure 8]