Cache static images permanently asp .net mvc

629 Views Asked by At

I want all my static images to get cached on browser (on first request) and fetched from browser cache for further request to the page.

I tried adding <clientCache cacheControlMode="UseExpires" httpExpires="Fri, 23 Dec 2016 00:00:00 GMT" /> to my Web.config, but it still does a request to the server and gets 304 as return.

What i am trying is to permanently cache static images on client side, so that it doesn't request to server and images are fetched from the browser cache.

Can someone please help.

1

There are 1 best solutions below

1
On

You can use manifest attribute if HTML 5 in any web development environment. What you have to do is create manifest file, give images (or any static content) path there and use that file as a value of manifest attribute. More Info