Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 no-cache and IIS 5 gzip encoding?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

jstelly
Starting Member

USA
11 Posts

Posted - 19 December 2002 :  11:57:24  Show Profile
I'm running a snitz forum from my server at home. My bandwidth is respectable but not too impressive so I configured the IIS 5 compression feature for ASP. The bandwidth savings are great, my general forum goes from 180KB of HTML to around 8KB of gzipped HTML. The problem is that before the pages were working fine, but now they're being cached on the clients. Everyone has to hit F5 to get the pages to refresh.

So I'm guessing that the no-cache tag is getting stripped, but I don't see where in the forum code that is controlled.

Has anyone tried running snitz on IIS with the gzip encoding enabled, and if so, did you find a work around? Is there something simple I can change on the config or can someone point me to where I should look in the ASP code?

Thanks in advance,
Jon

bjlt
Senior Member

1144 Posts

Posted - 19 December 2002 :  12:25:42  Show Profile

Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1


you can add these codes on top of your asp pages, if you want no cache for all pages maybe you can add it in config.asp or inc_header.asp and inc_header_short.asp.

Does compression feature have any side effects? I'm concerned about bandwidth also, how do you config it? I'm not familiar with IIS.

Thanks
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 19 December 2002 :  12:30:45  Show Profile
I am not sure but the gzip encoding enabling might have added the HTTP headers.
Go to Top of Page

jstelly
Starting Member

USA
11 Posts

Posted - 19 December 2002 :  12:41:17  Show Profile
It's pretty simple to configure, and the bandwidth savings are impressive. There's some added CPU utilization, but I'd only expect that to come into play on really busy sites. They mention a server with 80%+ CPU utilization before compression as a machine you wouldn't want to try enabling it on. I'd think anything below that point could see big response-time savings on a low-bandwidth link, and chances are that a low-bandwidth site isn't going to be able to cause more than 20% cpu usage on any respectable machine.

http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/iis/maintain/featusability/httpcomp.asp

And I'll give those changes a shot, Bjlt. Thanks for the quick response. I'll probably try to put them into a function in inc_header and inc_header_short as you mention. Hmm, maybe a new include called inc_nocache that I include in those would be the cleanest thing.

Let me know if you have any luck or need help with the compression thing. I'm interested to see how it works for other people.

Edited by - jstelly on 19 December 2002 12:47:44
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 19 December 2002 :  15:47:43  Show Profile  Visit Gremlin's Homepage
I haven't tried gzip with the latest version of the forum, but with previous versions it was my observation that switching gzip on caused caching issue, even with the above caching directives added to the pages.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

jstelly
Starting Member

USA
11 Posts

Posted - 19 December 2002 :  16:08:48  Show Profile
I've added the following changes and everything seems to be working really well now. Maybe adding an admin option for this, like a checkbox for no-caching that would flip a boolean would be a good idea? Or maybe that kind of functionality to add an admin option is part of the add-on module framework that snitz has. I haven't been able to look around at it enough yet.

inc_func_common.asp (line 42)

%>
<%

'##############################################
'##            Cache Options                 ##
'##############################################


function SetCacheOptions()
	Response.CacheControl = "no-cache"
	Response.AddHeader "Pragma", "no-cache"
	Response.Expires = -1
end function


'##############################################
'##            Post Formatting               ##
'##############################################


Then:

inc_header.asp (line 43)

%>
<!--#INCLUDE FILE="inc_func_common.asp" -->
<%

SetCacheOptions()

if strShowTimer = "1" then


inc_header_short.asp (line 43)

%>
<!--#INCLUDE FILE="inc_func_common.asp" -->
<%

SetCacheOptions()

strArchiveTablePrefix = strTablePrefix & "A_"

Edited by - jstelly on 19 December 2002 16:10:15
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.51 seconds. Powered By: Snitz Forums 2000 Version 3.4.07