Validate your Lightsail distribution's content caching
In this guide, you will learn how to test that your Amazon Lightsail distribution is caching and serving content from your origin. You should perform this test after you add your registered domain name to your distribution. For more information about distributions, see Content delivery network distributions.
Test your distribution
Complete the following procedure to test your distribution. We use the Chrome web browser in this procedure; other browsers may use similar steps.
-
Open the Chrome web browser.
-
Open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools.
You can also use the shortcut Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux).
-
In the developer tools pane, choose the Network tab.
-
Browse to the domain of your distribution (e.g.,
https://www.example.com).The Network tab of the Chrome developer tools should populate with a list of objects from your website.
-
Choose a static object, such as an image file (.jpg, .png, .gif).
-
In the Header panel that appears, you should see that the
viaheader mentions CloudFront, and that thex-cacheheader showsHit from cloudfront. A value ofHit from cloudfrontconfirms that your distribution served the object from its cache. If you instead seeMiss from cloudfront, the object wasn't in the cache yet and was fetched from your origin; reload the page and check again, and the subsequent request should show aHit.