Response.Expires Brief Introduction

Source: Internet
Author: User
Expires|response by default, the ASP disables browser and proxy buffering capabilities. If you have a page that you don't want to update every time, you should open the browser and the proxy buffer, which will allow the browser and the agent to use the page's "buffered" copy of the data for a while. Buffering can greatly reduce the amount of data reprinted by the server and improve the browsing performance of the users.
Which categories of dynamic pages fit to be cached? Here are some examples:
Weather page, updated every 5 minutes
News or version list page, updated 2 times per day
Note: When you use a browser or proxy cache, the number of clicks on the Web server is reduced. If you want to get an accurate picture of all the pages, or for mailing ads, it is not appropriate to use the browser and proxy caching.
The browser cache is controlled by the HTTP "Expires" header parameter, which is sent to the browser by the Web server. ASP provides 2 simple ways to send this header parameter. You can use the Response.Expires property to set the page to expire within a certain period of time. The following example will tell the browser that the content expires in 10 minutes:<% Response.Expires =% >
If you set Response.Expires to negative or 0, caching is disabled. The setting for the 2nd attribute, Response.ExpiresAbsolute, allows you to specify that the content expires when a particular time arrives.
<% Response.ExpiresAbsolute = #May 31,2001 13:30:15#% >
In addition to using the response object to set expiration times, you can also write < META > tags in the header of an HTML file. Although the agent will not notice this tag, some browsers can.
< META http-equiv= "Expires" value= "may 31,2001 13:30:15" >
Finally, for HTTP proxies, use Response.CacheControl to indicate whether the content is cached. Sets the property to "public" to open the proxy cache content.
<% Response.CacheControl = "public"% >
By default, this property is set to Private. Note: Do not let the proxy buffer those pages that are displayed to a particular user because the agent may send a page belonging to another user to the current user.

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.