Client Cache)

Source: Internet
Author: User

Generally, you have done a lot of caching work on the server side. ASP. NET cache or memerycache always ignore the client cache.

As we all know that no matter which client will cache the accessed site, but the browser cache time is short, it is best to customize extended browser cache.

At this time, you need to modify the HTTP header information, which contains a field:

Cache-control:No-Cache

There are many ways to modify the header field. It is more convenient to set in Web. config. For example:

<? XML version = "1.0"?>
<Configuration>
<System. webserver>
<Staticcontent>
<Clientcache cachecontrolmode = "usemaxage" cachecontrolmaxage = "10.00: 00: 00"/>
</Staticcontent>
</System. webserver>
<System. Web>
</System. Web>
</Configuration>

This setting sets the File Cache life to 10 days, which is valid for all files in the Current Config directory. If you need to set a file separately, you can use the <location> section to configure it.

In addition to the lifecycle, you can set the expiration time, for example,. I prefer the lifecycle ,:)

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.