Several sentences of ASP cache
1.Application variable
Captive variables are generally used: application (variable name) = [variable value]
Put these statements in global.asa under the root directory of the website to get global variables.
2.buffer
The buffer attribute indicates whether to output the buffer page. When the buffer page outputs, only after all the server scripts on the current page are processed or the Flush or END method is called, the server sends the response to the client.
After the server is sent to the client, the buffer attribute cannot be set. Therefore, the response.buffer should be called in the first line of the .asp file.
grammar
Response.buffer [= Flag] parameter
Flag
Specify whether the buffer page output can be one of the following values. Value description
FALSE is unstoppable. This value is the default value. The server sends the output to the client while processing the script.
In unless all ASP scripts on the current page are processed or the Flush or END method is called, the server does not send the response to the client.
Annotation
If the current ASP script cushion is set to True, but the Flush method is not called, the server will keep the client's request to keep activities. Since the server does not need to create a new connection for each client, it saves time.
However, the buffer will prevent the response from displaying the response at the client before all scripts on the previous page. For long scripts, you may feel delay.
That is, when the buffer is true, the ASP will send this program to the client together after the program is explained.
When the buffer is false, ASP will send data while parsing.
<% Response.buffer = True%> This sentence means to indicate whether the output page is cushioned. When the attribute value is TRUE, the server will not send any information to the client until all programs are executed or encountered <%% Response.flush %> or < %Response.end %> statements will release information of the buffer.
The following code demonstrates this feature of Buffer:
1 <% 2Response.charset = gb2312 3Response.buffer = false 4dim STR256 5STR256 = 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ RSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSNOPQRSTUVWXYZ1234567890ABCDEFGHI BCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSNOPQRSTUVWXYZ 6 7Response.write TE (STR256 &) 12 Response.write (i & <br>) 13next14Response.write (end) 15%>
If the response.buffer = false is changed to response.buffer = true, it will be parsed and output, that is, output a web page containing 1 to 100 numbers
Although the buffer attribute of Response can increase the display speed of the page, what is the situation. If you are making an ordinary personal homepage, the access volume is not very high, and there is no complicated execution program, then it is not important to use this attribute, because it takes some time to buffer the data, but we can't feel it. ; But if you are making a large forum or a product display or other business sites, and the number of access is very high, then I suggest to join the first line of the program
< % Response.buffer = TRUE %>
This sentence is because this can allow customers to get more data within effective time.
3.Expires
Grammar: response.expires = [time]
After using the browser or proxy cache, the number of clicks on the web server will be reduced. If you want to accurately understand all pages or post advertisements, it is not suitable for using browsers and agents to cache.
The browser cache is controlled by the HTTPEXPIRES header parameter, and it is sent to the browser by the Web server. ASP provides two simple methods to send this head parameter. The setting page expires within a certain period of time, and you can use the response.expires property. The following example will tell the browser content after 10 minutes: < % Response.expires = 10 %>
Set response.expires to negative or 0, and the cache is prohibited. For the settings of the second attribute Response.expiresabsolute, the content of the content of a special time is allowed to expire.
< % Response.expiresabsolute = #May 31,2001 13: 30: 15 # %>
In addition to using the Response object to set the expiration time, you can also write the <Meta> mark on the HTML file header. Although the agent will not notice this mark, some browsers can.
<Meta http-equiv = expires value = May 31,2001 13:30:15>
Finally, for the HTTP proxy, using Response.cacheControl can indicate whether the content of the cache is cached. Set the function of Public to open the function of the proxy cache content.
< % Response.cacheControl = PUBLIC %>
By default, this attribute is set to Private. Note: Do not allow the agent to buffer those pages displayed to specific users, because the agent may give the pages belonging to other users to the current users.