Login

Username
Password




Register   Reset password

Get Cuyahoga at SourceForge.net. Fast, secure and Free Open Source software downloads

Forum

Welcome Guest Search | Active Topics | Members

Adding gzip compression to Cuyahoga pages Options
netnut
Posted: Sunday, March 6, 2011 2:08:42 PM
Rank: Member
Groups: Member

Joined: 7/3/2006
Posts: 10
Points: 15
Location: Australia
Hi Folks,

Has anyone successfully implemented gzip compression to Cuyahoga pages?

I have been trying to find a way to do this for ages but I can't get it to work properly.

The biggest problem is that it seems to compress the javascript and stylesheets occassionally.

I have been trying this using .NET's built in compression functions and have added an override to the PageRequestModule at context_PreRequestHandlerExecute.

Am I on the right track?

BTW, I am using Cuyahoga 2.0 Alpha, not Constructors excellent version 2 fork.

Constructor
Posted: Monday, March 7, 2011 4:45:42 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
Can you explain a little about what you are trying to achieve?

Also... regarding:

netnut wrote:
Hi Folks,

BTW, I am using Cuyahoga 2.0 Alpha, not Constructors excellent version 2 fork.



Cuyahoga 2.0 Alpha is my version wink
netnut
Posted: Monday, March 7, 2011 7:21:19 AM
Rank: Member
Groups: Member

Joined: 7/3/2006
Posts: 10
Points: 15
Location: Australia
Hi John,

I should have been more specific regarding the version...it is the old version 2 with the MVC stuff in it.

Anyway, what I want to do is compress the response using either gzip or deflate encoding. I do this all the time in standard .NET sites by adding a function to the PreRequestHandlerExecute method in the global.asax file and it works fine.

Trying to the same thing in Cuyahoga is a bit of a hit and miss affair. Sometimes it works as it should, other times it compresses everything, javascript files, stylesheets, images the lot which results in a non-functioning site.

I was hoping you could tell me where in the Cuyahoga page life cycle I should implement the compression as I have a feeling I am doing this in the wrong place or not filtering the response correctly.
netnut
Posted: Monday, March 14, 2011 2:17:10 PM
Rank: Member
Groups: Member

Joined: 7/3/2006
Posts: 10
Points: 15
Location: Australia
I managed to sort this out.

The problems I was having were being caused by two things.

1. I had an email obfuscator HttpModule that was rewriting the Filter object before being handled by my page compression function. They didn't get along :-(
2. I was trying to implement the page compression function in the wrong part of the Cuyahoga page cycle.

I fixed this by removing the obfuscation module and placing the page compression function into its own HttpModule.

So far, so good. All the right bits are being compressed and the response now seems quite nippy!

Thanks for your help. It is always appreciated.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Yet Another Forum.net version 1.9.0 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.