开发者

ASPX WebMethod seems not to be caching results

开发者 https://www.devze.com 2023-02-05 18:37 出处:网络
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 cach

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

0

精彩评论

暂无评论...
验证码 换一张
取 消