We have already seen on how we can add a Http expire header for different file formats.
As far as nginx is concerned.
So let's go back to the configuration file just to revise.
So if we look over here, the any file which ends with Dot PNG, it is set to expire for one hour.
So if we do a curl.
I example.com.
Logo dot PNG.
You see it is actually expiring for 3600 seconds, which is one hour.
So this is just a header fields So how can we be like 100% sure that browser is actually storing this
particular file in its cache for maximum of one hour?
So let's see on how we can be very sure that the browser is doing as instructed in the Http header fields.
So this is a Mozilla firefox browser.
So.
Let's go to about cash.
And this basically gives caching related information as far as browser is concerned.
So if we see over here, the number of entries in the disk is 1696 and the number of entries in the
memory is zero.
So let's open a.
Image file from the server.
Example.com.
Image one dot PNG.
Now, before we open this, just make sure this is one six, nine, six.
And if I see the image has been loaded and if I refresh the page, you see the number of entry has been
increased by one.
So if I go to list cache entries and if I search for image one dot PNG, this is the URL that we had
opened.
This is the size of that particular URL.
And here it is also saying the time of response and when the response will be.
Expired.
So this is the time where the cash was stored, which is 75.
And at eight five, this cash will be expired.
So if we look into the.
Header field.
You can see the cache is expiring exactly after one hour.
So now we can be 100% sure that the browser is actually storing this file into its cache memory for
one hour.
So this becomes very useful when debugging issues comes into picture.
So this is short video.
This is what I wanted to show to you.
This is something which will be very useful in the production environment when you have caching related
issues.
So this is it.
About this small module.
I hope this has been informative for you, and I'd like to thank you for viewing.