I'm relatively new to asp.Net and have a question regarding caching...
We have a number of webforms that use Ajax and I have been asked whether data is being cached either on the client or server side.
Looking at the aspx & .cs code pages, I dont see any mention of caching.
The web server is running on Win 2003 Server (IIS 6).
So, can anyone advise as to whether or not caching occurs by default? How can I go about determining if caching has been enabled/disabled on both client and server side?
The easiest way to tell if there is client-side caching is to use various browser developer tools and see what is being cached client-side. Chrome and IE have developer tools built-in, and Firefox has the crazy good Firebug.
If you havn't coded any caching there will still be some caching going on. Client browsers cache web pages so that if you hit the back button or choose a page from your history they will often display what they have cached in memory and not go to the remote
server to retrieve the page, Browsers will also cache files such as stylesheets so that they dont pull a stylesheet from the server if it has retrieved it already. Browsers will also cache javascript libraries so if it has already retrieved a particular library
from a particular location it wont retrieve it again. However, caching in the context of asp.net often refers to programatic caching of which there are numerous options (e.g. http://msdn.microsoft.com/en-us/library/aa478965.aspx and http://www.aspnet101.com/2010/07/asp-net-caching-tutorial-part-1/).
A lot of thought needs to go into caching also, since it will use server resources, you need to be selective in the way you cache things and which techniques to use. e.g. if you have a query that takes a long time, and it gets hit a lot, but the data hardly
changes, then this is a good candidate for cache.
Please remember to Mark As Answer if helpful
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)
Thanks for all the suggestions, but I'm afraid that I am still somewhat "in the dark".
To further explain the situation....
We have an Intranet based finance application that is based around asp.net webforms (that use AJAX) which pull & post data to a Sharepoint based workflow application (K2 Blackpearl).
I have been approached by our internal IT security compliance department, asking if caching occurs on either the users' machines or the server. If caching does occur they would like us to disable it.
Now, as per my original post, I dont even know how to determine if and where caching does occur, and it caching is occuring, whether it can be disabled and what impact this would have on both functionality and performance.
Unforetunately, I do not have a great deal of knowledge for any of the components (asp.net, ajax, sharepoint, K2 Blackpearl, etc) to answer any of these questions. The only other person in the company that touches the development/support side is currently
on maternity leave until next year, and even if she was here, I doubt that she would have the answers either!
What type of caching are they concerned with? saving data from db locally? using cookies? IE will save content locally, as in images, stylesheets etc. but unless your explicitly saving data to file on the users machine (which I doubt you would be, since
you need elevated privileges) you should be fine.
Please remember to Mark As Answer if helpful
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)
Thats a very good point - it did cross my mind as to what exactly are they looking for...
Sure, things like images, etc would get cached on the user's machine, but data entered into the form by the user probably wouldn't be cached (I certainly cannot see anything in the code that suggests otherwise).
However, when the user retrieves a part completed form, would the data then be cached locally by default?
you can have your browser remember certain settings, and you can use plugins to attempt to fill out a lot of the forms for you, but this would be a browser setting and not an application setting.
Please remember to Mark As Answer if helpful
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)
GaryK26
Member
1 Points
15 Posts
asp.Net & caching (the very, very basics)
May 24, 2012 09:08 AM|LINK
Hi,
I'm relatively new to asp.Net and have a question regarding caching...
We have a number of webforms that use Ajax and I have been asked whether data is being cached either on the client or server side.
Looking at the aspx & .cs code pages, I dont see any mention of caching.
The web server is running on Win 2003 Server (IIS 6).
So, can anyone advise as to whether or not caching occurs by default? How can I go about determining if caching has been enabled/disabled on both client and server side?
Many Thanks
Gary
DarrellNorto...
All-Star
86809 Points
9646 Posts
Moderator
MVP
Re: asp.Net & caching (the very, very basics)
May 24, 2012 09:14 AM|LINK
The easiest way to tell if there is client-side caching is to use various browser developer tools and see what is being cached client-side. Chrome and IE have developer tools built-in, and Firefox has the crazy good Firebug.
Here's a quick primer: http://www.daniweb.com/web-development/javascript-dhtml-ajax/reviews/351831/ie9s-f12-developer-tools-vs-firebug
As for server-side, caching is configured in several different places and ways. See this page for an overview: http://msdn.microsoft.com/en-us/library/ms178597.aspx
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
frez
Contributor
5418 Points
913 Posts
Re: asp.Net & caching (the very, very basics)
May 24, 2012 09:14 AM|LINK
RameshRajend...
Star
7983 Points
2099 Posts
Re: asp.Net & caching (the very, very basics)
May 24, 2012 09:15 AM|LINK
pls check
http://forums.asp.net/t/1572590.aspx
http://forums.asp.net/t/1119882.aspx
christiandev
Star
8607 Points
1841 Posts
Re: asp.Net & caching (the very, very basics)
May 24, 2012 09:46 AM|LINK
Also, take a look here...
http://www.codeproject.com/Articles/6158/Caching-in-ASP-NET
A lot of thought needs to go into caching also, since it will use server resources, you need to be selective in the way you cache things and which techniques to use. e.g. if you have a query that takes a long time, and it gets hit a lot, but the data hardly changes, then this is a good candidate for cache.
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)
GaryK26
Member
1 Points
15 Posts
Re: asp.Net & caching (the very, very basics)
May 24, 2012 10:09 AM|LINK
Thanks for all the suggestions, but I'm afraid that I am still somewhat "in the dark".
To further explain the situation....
We have an Intranet based finance application that is based around asp.net webforms (that use AJAX) which pull & post data to a Sharepoint based workflow application (K2 Blackpearl).
I have been approached by our internal IT security compliance department, asking if caching occurs on either the users' machines or the server. If caching does occur they would like us to disable it.
Now, as per my original post, I dont even know how to determine if and where caching does occur, and it caching is occuring, whether it can be disabled and what impact this would have on both functionality and performance.
Unforetunately, I do not have a great deal of knowledge for any of the components (asp.net, ajax, sharepoint, K2 Blackpearl, etc) to answer any of these questions. The only other person in the company that touches the development/support side is currently on maternity leave until next year, and even if she was here, I doubt that she would have the answers either!
christiandev
Star
8607 Points
1841 Posts
Re: asp.Net & caching (the very, very basics)
May 24, 2012 10:20 AM|LINK
What type of caching are they concerned with? saving data from db locally? using cookies? IE will save content locally, as in images, stylesheets etc. but unless your explicitly saving data to file on the users machine (which I doubt you would be, since you need elevated privileges) you should be fine.
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)
GaryK26
Member
1 Points
15 Posts
Re: asp.Net & caching (the very, very basics)
May 24, 2012 10:43 AM|LINK
Thats a very good point - it did cross my mind as to what exactly are they looking for...
Sure, things like images, etc would get cached on the user's machine, but data entered into the form by the user probably wouldn't be cached (I certainly cannot see anything in the code that suggests otherwise).
However, when the user retrieves a part completed form, would the data then be cached locally by default?
christiandev
Star
8607 Points
1841 Posts
Re: asp.Net & caching (the very, very basics)
May 24, 2012 11:06 AM|LINK
you can have your browser remember certain settings, and you can use plugins to attempt to fill out a lot of the forms for you, but this would be a browser setting and not an application setting.
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)