Print Page | Close Window

Difference? Response.AddHeader vs CacheControl

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Using ProductCart
Forum Description: Running your store with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=5811
Printed Date: 06-July-2024 at 4:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Difference? Response.AddHeader vs CacheControl
Posted By: Brett
Subject: Difference? Response.AddHeader vs CacheControl
Date Posted: 28-February-2014 at 11:57pm
I'm trying to optimize our pages so they'll load faster. Chrome's "Audit" thing wants me to enable caching. I was able to do so one one page by changing:


Response.CacheControl = "no-cache"
...to...

Response.CacheControl = "private"

However, just about every file in ProductCart has these lines at the top:

<% response.Buffer=true
Response.Expires = -1
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>

It seems like AddHeader "cache-control" and CacheControl "no-cache" are redundant. Is there any reason for them both being here? Do they do something different? If I want to enable caching, which one should I change / remove?

Most importantly, will it screw anything up if I enable caching? Worst case scenario I can think of is we remove a product from the storefront or change the price, and a customer sees the old info.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net