Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leverage browser caching with web.config in .net?

Some of sites are on shared hosting (Windows 2003 Server), so I have no way to access server configuration.

I read everywhere about leverage browser caching, expecially for static files (jpg, css, js, etc.) but... how to do this in my case?

The hosting has .NET installed, could a web.config file help in some way? If yes, how?

like image 763
Ivan Avatar asked Apr 23 '11 09:04

Ivan


People also ask

How do I leverage browser caching?

Leveraging Browser Cache Using . First thing first, you can leverage browser caching by modifying the . htaccess file. To do so, you can use an FTP client like FileZilla or the file manager in your hosting control panel. This method might suit you well if you're an advanced user.

How do I fix leverage browser caching in WordPress?

Fixing Leverage Browser Caching in WordPress with the W3 Total Cache can be done by following the steps listed below: Download and install the W3 Total Cache WordPress plugin. Navigate to General Settings and select Enable Browser Cache. Click save and navigate to Browser Cache Settings (top of the page)

What is leverage browser caching WordPress?

About Leverage Browser Caching Leverage Browser Caching means storing static files of a website in visitor browser. And then retrieving them from browser quickly instead again from server. Actually it uses to speed up each page of a website.

Can web server do caching?

Web caching is the activity of storing data for reuse, such as a copy of a web page served by a web server. It is cached or stored the first time a user visits the page and the next time a user requests the same page, a cache will serve the copy, which helps keep the origin server from getting overloaded.


1 Answers

Here is how I did on my site that is on a shared host. I believe the cacheControlMaxAge is as follows days:hours:minutes:seconds but dont quote me.

<system.webServer>  
    <staticContent>
        <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="3.00:00:00" />
    </staticContent>
</system.webServer>
like image 89
CUTTHEMUSIC Avatar answered Oct 14 '22 04:10

CUTTHEMUSIC