Print Page | Close Window

Create a 3 day cache

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
Printed Date: 29 November 2023 at 4:58am
Software Version: Web Wiz Forums 12.06 -

Topic: Create a 3 day cache
Posted By: Roberto Randall
Subject: Create a 3 day cache
Date Posted: 24 June 2023 at 4:44pm
If I want to create a 3 day cache to put on a page, is this correct?

Response.Expires = 4320
Response.ExpiresAbsolute =  DateAdd("d", 3, Now())
Response.AddHeader "pragma","public"
Response.AddHeader "cache-control","public,max-age=259200"
Response.CacheControl = "public"

I am doing some tests for the images and I am not sure if this code is correct so that the page where I want to put it has a cache of 3 days.

Thank you.

------------- - -

Posted By: WebWiz-Bruce
Date Posted: 25 June 2023 at 11:15am
This should work for the actual page itself, but for the images you will need to configure output caching through the websites web.config file.

-------------" rel="nofollow - Web Wiz Forums Hosting" rel="nofollow - ASP.NET Web Hosting

Posted By: Roberto Randall
Date Posted: 25 June 2023 at 12:42pm
Thanks for answering.

Searching the net I have read in Microsoft:

The Expires," rel="nofollow - ExpiresAbsolute and" rel="nofollow - CacheControl properties have been deprecated in favor of the methods of the" rel="nofollow - HttpCachePolicy class available through the" rel="nofollow - Cache intrinsic object to control the Internet Information Services (IIS) output cache and client caches.

It is that I am doing tests with AspJpeg from Persits and I have created an asp page that changes the size of the image by means of a string (ej,. image.asp?width=230&file=myphoto.jpg) and for that reason I have to put the cache in the page, because I don't know if assigning a cache to a jpg via web.config will also do it to the results of this page.

------------- - -

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.06 -
Copyright ©2001-2023 Web Wiz Ltd. -