Like this article? We recommend
Usage Guidelines
To use the Caching Library in your web page, follow these steps:
- Download the code and include it in your ASP page.
- In each library included in your ASP page, set the library modification
date, similar to the code in Listing 1.
Listing 1 Set library modification date.
SetLastModified DateSerial(2006,10,01)
- If your web page relies on content in an external file, check that
file’s modification timestamp (see Listing 2).
Listing 2 Set external file-modification date.
SetLastModified getFileModifiedDate(Server.MapPath("path-to-file"))
- Check the modification date/time of the current script (see Listing 3)./p>
Listing 3 Set script-modification date.
SetLastModified getFileModifiedDate(getCurrentScript())
- If you’re not forcing revalidation on each request, you might want to set the expiration date. (See part 1 of this series.)
- Call the CheckModifiedDate subroutine. In Listing 4, forced
validation is disabled, content can be stored in public caches, and no entity
tag is associated with the content.
Listing 4 Check the conditional GET parameters.
CheckModifiedDate LastModified,False,False,Null