IISpeed On/Off based on request variables?

161 views
Skip to first unread message

James Moberg

unread,
May 3, 2013, 6:13:05 PM5/3/13
to sup...@we-amp.com
Is is possible to have IISpeed enabled based on different criteria like IP Address(es), User-Agent sub-string, existence of cookie, etc?

We'd like to enable it on a production website, but only under certain conditions so that we can compare performance without having to configure separate web roots.

For example:
IISpeed (CGI.IP_Address === '127.0.0.1') ? 'On' : 'Off'
IISpeed (isDefined('Cookie.IISpeed') && Cookie.IISpeed == '1') ? 'On' : 'Off'

Thanks.

Otto van der Schaaf

unread,
May 4, 2013, 2:22:48 AM5/4/13
to sup...@we-amp.com
You could talk to IISpeed using response headers from you scripts, like:
 
ModPagespeed: on
ModPagespeedFilters: add_instrumentation

There also is an experiment option that integrates nicely with google analytics, but I'm not sure that works OK in the current version. I have made some corrections to that code, which we will to release in our next version.[1]

Otto

[1]



Op zaterdag 4 mei 2013 00:13:05 UTC+2 schreef James Moberg het volgende:

Otto van der Schaaf

unread,
May 4, 2013, 7:00:05 AM5/4/13
to sup...@we-amp.com
We discussed this internally, and we think the Cookie stuff would be real good to have, great idea! So we will be looking in to that as well fairly soon.

Otto

Op zaterdag 4 mei 2013 00:13:05 UTC+2 schreef James Moberg het volgende:
Is is possible to have IISpeed enabled based on different criteria like IP Address(es), User-Agent sub-string, existence of cookie, etc?

James Moberg

unread,
May 9, 2013, 1:42:24 PM5/9/13
to sup...@we-amp.com
I like these options alot.  They'll provide lots of internal control.  I want the application I'm working on to be optimized, but under certain conditions, I'd like to control it so that I can quickly troubleshoot issues.

I'm using ColdFusion 10 and generated the following response header.  I see it in the server header response (using Firefox w/Firebug).
<CFHEADER NAME="ModPagespeed" VALUE="off">

It doesn't appear to work yet.  I'm using 0.98.2 (April 11,2013) on a development server and the HTML source code is still fully optimized.

Otto van der Schaaf

unread,
May 9, 2013, 2:19:02 PM5/9/13
to sup...@we-amp.com
RE: "It doesn't appear to work yet.  I'm using 0.98.2 (April 11,2013) on a development server and the HTML source code is still fully optimized."

Looking in to it



Otto van der Schaaf

unread,
May 9, 2013, 4:28:51 PM5/9/13
to sup...@we-amp.com
A little update: I found the cause of this. I will try to fix this asap. We should be putting out a new release fairly soon, and this will be fixed in that.

Otto

Op donderdag 9 mei 2013 20:19:02 UTC+2 schreef Otto van der Schaaf het volgende:

James Moberg

unread,
May 15, 2013, 12:42:24 PM5/15/13
to sup...@we-amp.com
We use CKEditor (and CKFinder) in some web applications to allow clients the ability to edit their content.  If IISpeed is enabled, it doesn't work.
http://ckeditor.com/

What's the best way to globally disable IISpeed for a couple of different sub-directories?

Is there a "DisableFilters" attribute that will disable everything without having to list everything?

Is there a way to list multiple paths or can only a single path be entered?  (The configuration page only showed single path samples http://www.iispeed.com/support/configuration.aspx )

Is this currently the best way to do it?

path:/CKEditor/.*
IISpeed DisableFilters trim_urls,sprite_images,defer_javascript,lazyload_images,rewrite_javascript,collapse_whitespace,remove_comments
!

path:/CKFinder/.*
IISpeed DisableFilters trim_urls,sprite_images,defer_javascript,lazyload_images,rewrite_javascript,collapse_whitespace,remove_comments
!

Thanks.

Otto van der Schaaf

unread,
May 15, 2013, 1:09:39 PM5/15/13
to sup...@we-amp.com

Next to disabling filters, you have 2 options. First, you could do this in your global configuration:

IISpeed Disallow /CKEditor/*

Disallow supports wildcard matching.

Alternatively, you can add a path like you already did:
path:/CKEditor/.*
IISpeed off
! # make sure noone enables it again later on.

IISpeed off makes IISpeed bail out very early in request processing in IIS.

You should be able match multiple paths like this, so you don't have to duplicate configuration.
path:/(CKEditor|CKFinder)/.*

One more thing:

There is a blacklist of (mostly js) files that we shouldn't attempt to rewrite, and the js files from CKEdit are among them. 
The current version of IISpeed has a bug which prohibits this blacklisting from working correctly,
but our development tree already has the fix in.

Let me know if this helped!

Otto

Otto van der Schaaf

unread,
May 15, 2013, 3:25:32 PM5/15/13
to sup...@we-amp.com
FYI, I just landed that makes it possible to set options through response headers on our dev tree as well.
So, next release you should be able to do this in ColdFusion (as discussed earlier):
<CFHEADER NAME="ModPagespeed" VALUE="off">

The cookies stuff still needs some more consideration, as it looks like that may have some gotcha's. 
So that may not make it in to the next release.

Otto

James Moberg

unread,
Oct 8, 2013, 5:08:53 PM10/8/13
to sup...@we-amp.com
The ModPagespeed "off" header isn't working (for ColdFusion 10).  It worked in a previous IISpeed release, but v1.1 seems to have dropped this feature.


<CFHEADER NAME="ModPagespeed" VALUE="off">

Is there any way to disable it programmatically?  (Otherwise some issues are very difficult to debug.)

Thanks.

Otto van der Schaaf

unread,
Oct 8, 2013, 5:15:14 PM10/8/13
to James Moberg, Support
Could you try again, but with:
<CFHEADER NAME="PageSpeed" VALUE="off">?


Otto van der Schaaf

unread,
Oct 15, 2013, 5:15:33 AM10/15/13
to sup...@we-amp.com, James Moberg
Hi James,

Could you confirm if this helped?

Thanks,

Otto

Op dinsdag 8 oktober 2013 23:15:14 UTC+2 schreef Otto van der Schaaf:

James Moberg

unread,
Oct 15, 2013, 6:02:50 PM10/15/13
to sup...@we-amp.com, James Moberg
"PageSpeed" is the new control request/response header (we communicated privately via email), but you indicated that it may not be working and will release an update soon.  Thanks!

gpablof...@gmail.com

unread,
Apr 3, 2014, 2:19:13 PM4/3/14
to sup...@we-amp.com
Hello,
I have a similar problem.

I need to disable the rename src path of all images caused by IISpeed like:

"...../images/folder/image1.jpg.pagespeed.ic.nuKfb_b9pD.jpg"

I need only original images path render

"...../images/folder/image1.jpg"

Because i have other process working on those images src path.

I tried doing:

IISpeed Disallow /images/*

And also

IISpeed Disallow /images/.*
IISpeed off
!

But i have no result.

Can any answer me wiith a solution to that?

Thanks,
Regadrs,

Otto van der Schaaf

unread,
Apr 3, 2014, 4:07:36 PM4/3/14
to gpablof...@gmail.com, Support
A few questions:

Could you PM your full configuration(s)?
What is the path of the file where you are adding the Disallows?
Are you running a 32 bits application pool on a 64 bits system?

Note that an alternative option here would be to disable rewrite_images for /images, and enable In-Place-Resource-Optimization (IPRO) instead. That would still allow some optimizations to be applied to the images -- leaving the urls in the html/css intact.

Otto
Reply all
Reply to author
Forward
0 new messages