ASP. NET MVC blocks the view page cache for the current request OutputCache

Source: Internet
Author: User

Setting up the cache

[OutputCache (Duration =333,varybycustom = "Index")]

Cache:

In action, the view page cache that temporarily blocks the request is Response.Cache.SetNoServerCaching ();//can make the default cache, within the specified expiration time, except for the first access, is 304. Response.Cache.SetOmitVaryStar (TRUE);

Main precautions, cyclic parameters to initiate requests, resulting in a large number of meaningless parameters generated by excessive garbage cache, a lot of memory-intensive situation.

Page caching can also be set

VaryByParam = "None"

Can be achieved, but it is not possible to generate different caches based on the parameters

[OutputCache (Duration =333,varybyparam = "None", VaryByCustom = "Index")]

ASP. NET MVC blocks the view page cache for the current request OutputCache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.