I need a couple of methods on an aspx page to cache their results to avoid lots of going to the database. I added the relevant WebMethod attributes but although the code runs, the methods are not caching their results.
The trouble is, I'm a) not sure whether this can be done in the first place, and if it is then b) whether there is something particular you need to do 开发者_运维百科on aspx pages to make this work.
Does a page's cached results only last the lifetime of the page? I need the data to be cached across many page requests.
Cache the response objects in your web service.
http://msdn.microsoft.com/en-us/library/6hbbsfk6(v=VS.100).aspx
EDIT:
This looks promising: http://support.microsoft.com/kb/318299
精彩评论