RewriteLevel PassThrough causes issues in vhosts

26 views
Skip to first unread message

Mat Kovach

unread,
May 12, 2015, 3:40:43 PM5/12/15
to mod-pagesp...@googlegroups.com
Interesting issue with pagespeed.

X-Mod-Pagespeed: 1.9.32.3-4448, running on CentOS 6, 64bit with Apache.

Setup some global settings, including ModPagespeedRewriteLevel PassThrough and dang it if nothing worked.

After poking around, I removed ModPagespeedRewriteLevel PassThrough from the global pagespeed.conf and move it to the vhost configuration and it worked. (And yes ModPagespeedInheritVHostConfig on is set in pagespeed.conf). Now, if I change the RewriteLevel of CoreFilters in the global config, things work as one would think, enabling and disabling of filters, etc.

Now moving the RewriteLevel to the vhost configuration isn't much of a hardship, it seems it may be a bug .. either with the apache module or myself. If any more information is needed I can provide it, but I at leasted when to get this document so some other poor slob doesn't waste time trying to figure out. (And if you are that person reading this in the future, hi).

Thanks,

Mat

Jeff Kaufman

unread,
May 13, 2015, 7:23:23 AM5/13/15
to mod-pagespeed-discuss
On Tue, May 12, 2015 at 3:40 PM, Mat Kovach <matk...@gmail.com> wrote:
> Setup some global settings, including ModPagespeedRewriteLevel PassThrough
> and dang it if nothing worked.
>

What do you mean "nothing worked"? Do you mean your site was broken
or PageSpeed wasn't making any optimizatoins?

> After poking around, I removed ModPagespeedRewriteLevel PassThrough from the
> global pagespeed.conf and move it to the vhost configuration and it worked.

And again, what is "worked"?

Mat Kovach

unread,
May 13, 2015, 8:17:44 AM5/13/15
to mod-pagesp...@googlegroups.com
On Wed, May 13, 2015 at 7:23 AM, 'Jeff Kaufman' via
mod-pagespeed-discuss <mod-pagesp...@googlegroups.com> wrote:
> On Tue, May 12, 2015 at 3:40 PM, Mat Kovach <matk...@gmail.com> wrote:
>> Setup some global settings, including ModPagespeedRewriteLevel PassThrough
>> and dang it if nothing worked.
>>
>
> What do you mean "nothing worked"? Do you mean your site was broken
> or PageSpeed wasn't making any optimizatoins?

Sorry, to clarify ... the site worked fine but none of the
optimizations would be performed. Enabling any filters would not alter
the page. If the global setting (changing RewriteLevel to CoreFilters)
was changed, all virtual hosts would have their pages optimized and
filters could be enabled, disabled.

>> After poking around, I removed ModPagespeedRewriteLevel PassThrough from the
>> global pagespeed.conf and move it to the vhost configuration and it worked.
>
> And again, what is "worked"?

Putting Passthrough in the global file effectively disabled any
optimizations and attempting to enable filters in virtual host did not
work. If core filters is the rewrite level, it operates as expected.

Our work around is to removed RewriteLevel from the global conf and
put it in the virtual host settings. This allows us to enable filters
selectivity per virtual site. It just seems like a bug that CoreFitler
works in the global as expected, but not RewriteLevel.

Does that clear it up?

--
Mat Kovach
Cleveland, Ohio
``Would Aristotle throw a spitball?''

Jeff Kaufman

unread,
May 13, 2015, 8:25:12 AM5/13/15
to mod-pagespeed-discuss
Are you saying you had this configured as:

Global:
ModPagespeedRewriteLevel PassThrough

VHost:
ModPagespeedEnableFilters filter_name;

And on that vhost filter_name wasn't enabled?

Could you paste the config you were using that didn't do what you expected?
> --
> You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CABWP46ARRz2Qm2_znqn3-4PK_WOgqoa%3DHC6Uv8Rsby-M9U6EAw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Mat Kovach

unread,
May 13, 2015, 12:04:56 PM5/13/15
to mod-pagesp...@googlegroups.com


On Wednesday, May 13, 2015 at 8:25:12 AM UTC-4, Jeff Kaufman wrote:
Are you saying you had this configured as:

Global:
    ModPagespeedRewriteLevel PassThrough

VHost:
    ModPagespeedEnableFilters filter_name;

And on that vhost filter_name wasn't enabled?


Global (pagespeed.conf)

 <IfModule pagespeed_module>
    ModPagespeed on
    ModPagespeedInheritVHostConfig on
    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
    # AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER application/xhtml+xml
    ModPagespeedFileCachePath            "/var/cache/mod_pagespeed/"
    ModPagespeedLogDir "/var/log/pagespeed"
    # The locations of SSL Certificates is distribution-dependent.
    ModPagespeedSslCertDirectory "/etc/pki/tls/certs"
    ModPagespeedSslCertFile /etc/pki/tls/cert.pem
    ModPagespeedMemcachedServers stg-pagespeed-memcache:11211
    # ModPagespeedCreateSharedMemoryMetadataCache "/var/cache/mod_pagespeed/" 51200
    ModPagespeedRewriteLevel PassThrough #Coimment this out to make it work ..
    # ModPagespeedRewriteDeadlinePerFlushMs 10
    # ModPagespeedDomain cdn.myhost.com
    # ModPagespeedFileCacheSizeKb          102400
    # ModPagespeedFileCacheCleanIntervalMs 3600000
    # ModPagespeedLRUCacheKbPerProcess     1024
    # ModPagespeedLRUCacheByteLimit        16384
    # ModPagespeedCssFlattenMaxBytes       2048
    # ModPagespeedCssInlineMaxBytes        2048
    # ModPagespeedCssImageInlineMaxBytes   0
    # ModPagespeedImageInlineMaxBytes      3072
    # ModPagespeedJsInlineMaxBytes         2048'
    # ModPagespeedCssInlineMaxBytes        2048
    # ModPagespeedCssImageInlineMaxBytes   0
    # ModPagespeedImageInlineMaxBytes      3072
    # ModPagespeedJsInlineMaxBytes         2048
    # ModPagespeedCssOutlineMinBytes       3000
    # ModPagespeedJsOutlineMinBytes        3000
    # ModPagespeedMaxCombinedCssBytes      -1
    # ModPagespeedMaxCombinedJsBytes       92160
    ModPagespeedFileCacheInodeLimit        500000
    # ModPagespeedImageMaxRewritesAtOnce      8
    # ModPagespeedNumRewriteThreads 4
    # ModPagespeedNumExpensiveRewriteThreads 4
    # ModPagespeedRewriteRandomDropPercentage 90
    # ModPagespeedJsPreserveURLs on
    # ModPagespeedImagePreserveURLs on
    # ModPagespeedCssPreserveURLs on
    # ModPagespeed PrivateNotVaryForIE on
    # ModPagespeedCombineAcrossPaths off
    # ModPagespeedAvoidRenamingIntrospectiveJavascript off
    # ModPagespeedRespectVary on
    ModPagespeedStatistics on
    ModPagespeedUsePerVHostStatistics on
   ModPagespeedStatisticsLogging on
    ModPagespeedMessageBufferSize 100000
</IfModule>

Then inside one of the vhost configuration (there are three on the box), we include:

<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedRewriteLevel PassThrough

ModPagespeedEnableFilters add_head
ModPagespeedEnableFilters canonicalize_javascript_libraries
ModPagespeedEnableFilters combine_css
ModPagespeedEnableFilters combine_javascript
ModPagespeedEnableFilters convert_meta_tags
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters fallback_rewrite_css_urls
ModPagespeedEnableFilters flatten_css_imports
ModPagespeedEnableFilters inline_css
ModPagespeedEnableFilters inline_import_to_link
ModPagespeedEnableFilters inline_javascript
ModPagespeedEnableFilters recompress_images
ModPagespeedEnableFilters rewrite_css
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters rewrite_javascript
ModPagespeedEnableFilters rewrite_style_attributes_with_url
ModPagespeedEnableFilters add_instrumentation

#ModPagespeedEnableFilters defer_javascript
#ModPagespeedEnableFilters prioritize_critical_css

<Location "/pagespeed_admin">
  <IfModule mod_rewrite.c>
    RewriteEngine Off
  </IfModule>

  Order allow,deny
  Allow from localhost
  Allow from 127.0.0.1
  SetHandler pagespeed_admin
</Location>
</IfModule>

> To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages