ASP Classic Page Cache

Set page to cache at certain time or force cache refresh.
Something I found online few months ago and wanted to document it in case needed.

CodeFunctionName
What is this?

Public

Tested

Imported
< %
' Set how many minutes a page will be cached
' This example demonstrates the Expires property. This property sets how long a page will be cached in a browser before it expires. If the user returns to the same page before the specified number of minutes have elapsed, the cached version is displayed. If you set minutes to 0, the page will never be cached on a browser.

Response.Expires = 0
% >
< html >
< body >
< p >This page will be refreshed with each access! < /p >
< /body >
< /html >

< %
' Set a date/time when a page cached
' This example demonstrates the ExpiresAbsolute property. This property sets a date/time when a page cached in a browser will expire. If the user returns to the same page before the specified date/time, the cached version is displayed.

Response.ExpiresAbsolute = #May 05,2023 05:30:30#
% >
< html >
< body >
    < p >This page will expire on May 05, 2023 05:30:30! < /p >
< /body >
< /html >

Views 80

Downloads 36

CodeID
DB ID

ANmarAmdeen
602
Attachments
Revisions

v1.0

Friday
May
20
2022