Any recommendations for implementing caching in ASP Classic. Server is Windows 2008 with IIS 7.5

Recommended Answers

All 2 Replies

It can be done. While most would say just upgrade the site to ASP.NET where you its easy to implement caching, it can be done in Classic ASP. Take a look at this article from 4GuysFromRolla. They have quite a bit of stuff on Classic ASP. A few articles on caching.

http://www.4guysfromrolla.com/webtech/032002-1.shtml

If you are caching blocks of data that won't change based on the user, then I would highly recommend using Application variables. You can simply do something like:

if Not IsDate(Application("var_date")) then Application("var_date") = Now() - 1

if Application("var_date") < Now Then
    Application("html_cache") = "INSERT HTML HERE"
    Application("var_date") = DateAdd("n",5,Now)
end if
Response.Write(Application("html_cache"))

This will cache for 5 minutes and this method can be very powerful if you are working with high volume sites. This is best used where you are hitting your database.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.