This feature gives you the ability to force your app/website to get the latest version of a resource from the server, instead of getting a cached one.
This tutorial will show you how to use the No Caching feature to force your browser to get the latest version of a NY Times from their servers instead of getting a cached version.
- Install Charles
- Make sure you have setup the Charles Root certificate on your Mac before you proceed to the next step
Find the image URL
In Chrome, right-click the image -> select the “Copy image address” option
I am using this image URL
Enable SSL Proxying
In Charles, find the Request, right-click it and select “Enable SSL Proxying” from the dropdown.
The Request(s) you want to modify must be decrypted before you can use the No Caching feature
304 status code
If the Response has a 304 status code, you’re getting a cached result
Open No Caching settings screen
Tools -> No Caching
Now tick both “Enable No Caching” and “Only for selected locations” checkboxes
Enter URL you want to stop caching
Add -> paste image URL into the “Host” field -> press tab -> enter 443 as the “Port” value -> click OK to save -> click OK to close the settings screen
Resend the Request
Click the “Repeat” button to reload the Request
The status code of the Response should change from 304 to 200
How it works
As you can see from the screenshot, Charles swaps 2 headers in the Request (image on the left) with the ‘pragma’ and ‘cache-control’ headers in the second Request (image on the right)
You can also achieve a similar result by using Rewrites