WEBVTT

00:00.580 --> 00:07.180
We have already seen on how we can add a Http expire header for different file formats.

00:07.210 --> 00:09.520
As far as nginx is concerned.

00:10.420 --> 00:15.760
So let's go back to the configuration file just to revise.

00:18.330 --> 00:26.130
So if we look over here, the any file which ends with Dot PNG, it is set to expire for one hour.

00:27.240 --> 00:29.040
So if we do a curl.

00:32.560 --> 00:34.580
I example.com.

00:36.430 --> 00:37.510
Logo dot PNG.

00:39.490 --> 00:44.500
You see it is actually expiring for 3600 seconds, which is one hour.

00:45.070 --> 00:54.520
So this is just a header fields So how can we be like 100% sure that browser is actually storing this

00:54.520 --> 00:59.890
particular file in its cache for maximum of one hour?

01:00.070 --> 01:08.920
So let's see on how we can be very sure that the browser is doing as instructed in the Http header fields.

01:09.810 --> 01:12.360
So this is a Mozilla firefox browser.

01:13.830 --> 01:14.910
So.

01:16.470 --> 01:18.300
Let's go to about cash.

01:18.450 --> 01:24.180
And this basically gives caching related information as far as browser is concerned.

01:24.840 --> 01:32.610
So if we see over here, the number of entries in the disk is 1696 and the number of entries in the

01:32.610 --> 01:34.830
memory is zero.

01:35.880 --> 01:38.010
So let's open a.

01:39.870 --> 01:42.210
Image file from the server.

01:42.480 --> 01:43.830
Example.com.

01:45.690 --> 01:47.490
Image one dot PNG.

01:49.570 --> 01:53.560
Now, before we open this, just make sure this is one six, nine, six.

01:53.680 --> 02:02.890
And if I see the image has been loaded and if I refresh the page, you see the number of entry has been

02:02.890 --> 02:04.180
increased by one.

02:05.430 --> 02:12.570
So if I go to list cache entries and if I search for image one dot PNG, this is the URL that we had

02:12.570 --> 02:13.200
opened.

02:13.530 --> 02:16.410
This is the size of that particular URL.

02:16.560 --> 02:22.740
And here it is also saying the time of response and when the response will be.

02:23.860 --> 02:24.660
Expired.

02:24.670 --> 02:28.540
So this is the time where the cash was stored, which is 75.

02:28.840 --> 02:32.920
And at eight five, this cash will be expired.

02:33.130 --> 02:35.800
So if we look into the.

02:36.990 --> 02:37.950
Header field.

02:38.130 --> 02:41.970
You can see the cache is expiring exactly after one hour.

02:42.270 --> 02:51.300
So now we can be 100% sure that the browser is actually storing this file into its cache memory for

02:51.300 --> 02:51.930
one hour.

02:52.200 --> 02:59.220
So this becomes very useful when debugging issues comes into picture.

02:59.460 --> 03:01.140
So this is short video.

03:01.170 --> 03:02.940
This is what I wanted to show to you.

03:02.940 --> 03:09.120
This is something which will be very useful in the production environment when you have caching related

03:09.120 --> 03:09.810
issues.

03:10.780 --> 03:11.800
So this is it.

03:11.800 --> 03:14.010
About this small module.

03:14.020 --> 03:17.830
I hope this has been informative for you, and I'd like to thank you for viewing.
