|
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.
|
|
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
|
|
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.
|
|
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.
|
|
Guest |