Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - Create a 3 day cache
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Create a 3 day cache

 Post Reply Post Reply
Author
Roberto Randall View Drop Down
Senior Member
Senior Member
Avatar

Joined: 21 August 2009
Location: San Pedro Alc.
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roberto Randall Quote  Post ReplyReply Direct Link To This Post Topic: Create a 3 day cache
    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.
https://www.lanocion.es - https://www.lanocion.games - https://www.lanocion.chat
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9761
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Roberto Randall View Drop Down
Senior Member
Senior Member
Avatar

Joined: 21 August 2009
Location: San Pedro Alc.
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roberto Randall Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2023 at 12:42pm
Thanks for answering.

Searching the net I have read in Microsoft:


The Expires, ExpiresAbsolute and CacheControl properties have been deprecated in favor of the methods of the HttpCachePolicy class available through the 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.
https://www.lanocion.es - https://www.lanocion.games - https://www.lanocion.chat
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

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


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2023 Web Wiz Ltd. All rights reserved.