views:

111

answers:

2

Hi All,

I have a master page, inside that I have a menu controls and other css, JS files.

Whenever I refresh the page from client, everything is coming from the server.

Now I want to cache those controls and those files as per session.

Is there any setting or programmatic settings there to do it?

A: 

You should read up on ASP.Net Caching - there are lots of flexible ways to cache your pages.

However in your case, it sounds like you should just be able to add the OutputCache directive to the top of your page:

<%@ OutputCache Duration="60" VaryByParam="None"%>

Static CSS and JS files should be cached automatically by the browser. If you've embedded them as webresources then the caching directives will help you cache them as well.

womp
A: 

There's no problem with JS and other items cached on client.

But yes, there's a concern on dynamic controls as they are not simply compiled and depend on request. And here's an article in Smöråkning blog on how to cache them.

terR0Q