How to find out if the content is coming from cache or original server

Lets say your debugging issue of why the new image that you just uploaded on your server is not getting reflected on a page and want to find if that image is coming from a proxy cache server somewhere in between.

The Http Protocol does not have any header that (Via header can be used by advanced proxies but i had never seen that) can tell you if the image is coming from cache somewhere instead of original server. You can use the Date header to figure out if the request is coming from the cache or actual server.

As per the Specification Date header represents the time when the response was generated by server. Now if Proxy is caching the response it will also cache the Date header value and when you try accessing that resource, cache will return you cached copy as well as value of Date header.

Ex. I tried going to on 14 th of July and these are the headers that i am getting

As you can see that the value of Date header is 12th of July, which means that the cache got response from server on 12 th of July and that response is cached. If you look at value of cache-control header it is set to max-age=315360000, which is 10 years. Value of Expires headers is 09 July 2020, which means the server is saying that the image is valid for next 10 years. So when proxy gets a request for the first time it will get the image and keep it in cache for other clients for next 10 years, it wont even check if the image is updated for next 10 years and keep returning Date header with value when it actually got the image from server.


srjwebsolutions said...

We are leading responsive website designing and development company in Noida.
We are offering mobile friendly responsive website designing, website development, e-commerce website, seo service and sem services in Noida.

Responsive Website Designing Company in Noida
Website Designing Company in Noida
SEO Services in Noida
SMO Services in Noida

BatteryMantra No. 1online battery store said...

Battery Mantra is Authorized exide car battery dealer in Noida and Greater Noida. We are providing our service in Indirapuram, Delhi, Ashok Nagar.

Exide Battery Dealer in Noida
Battery Dealer in Noida
Authorized Battery Dealer in Noida
Car Battery Dealer in Noida
Car Battery Dealer
Exide Battery Dealer

Genxsoft said... is online medical store pharmacy in laxmi nagar Delhi. You can Order prescription/OTC medicines online.
Cash on Delivery available. Free Home Delivery

Online Pharmacy in Delhi
Buy Online medicine in Delhi
Online Pharmacy in laxmi nagar
Buy Online medicine in laxmi nagar
Onine Medical Store in Delhi
Online Medical store in laxmi nagar
Online medicine store in delhi
online medicine store in laxmi nagar
Purchase Medicine Online
Online Pharmacy India
Online Medical Store

Abhi said...

Thanks for info
Web Design Company in Bangalore
Website development in Bangalore

Abhi said...

Thanks for info
Customized Crm Solutions

Amaron KL Battery said...

Century battery installation and delivery services are available in your area. It's only a phone call or a WhatsApp message away. We will arrive at your home or location as soon as possible to assist you.

For further information please click below links

Amaron Battery Near Me & Car Battery Delivery Service