If I use ModPagespeeedImagePreserveURLs in .htaccess I get this error:
.htaccess: Invalid command 'ModPagespeeedImagePreserveURLs', perhaps misspelled or defined by a module not included in the server configuration
I tried it before uncommenting it on pagespeed.conf, given that error trying to use it on .htaccess I assumed that this configuration should be on pagespeed.conf, maybe it is a version error? I should be running 1.9.32.3 but I can't find a way on pagespeed_admin to identify my running version, anyway I have this on the "Configuration" tab on pagespeed_admin.
Version: 13: on
Filters
ah Add Head
cc Combine Css
jc Combine Javascript
gp Convert Gif to Png
jp Convert Jpeg to Progressive
jw Convert Jpeg To Webp
mc Convert Meta Tags
pj Convert Png to Jpeg
ec Cache Extend Css
es Cache Extend Scripts
fc Fallback Rewrite Css
if Flatten CSS Imports
hw Flushes html
ci Inline Css
il Inline @import to Link
ji Inline Javascript
js Jpeg Subsampling
rj Recompress Jpeg
rp Recompress Png
rw Recompress Webp
cf Rewrite Css
jm Rewrite External Javascript
jj Rewrite Inline Javascript
cu Rewrite Style Attributes With Url
cp Strip Image Color Profiles
md Strip Image Meta Data
Options
EnableRewriting (e) 1
FileCacheInodeLimit (afcl) 500000
FileCachePath (afcp) /var/cache/mod_pagespeed
ImagePreserveURLs (ipu) True
ImageRecompressionQuality (irq) 95
JpegRecompressionQuality (iq) -1
LogDir (ald) /var/log/pagespeed
SslCertDirectory (assld) /etc/ssl/certs
StatisticsLogging (asle) True
WebpRecompressionQuality (iw) -1
Domain Lawyer
Invalidation Timestamp: (none)
I tried removing sprite_images and adding
ModPagespeedRewriteLevel PassThrough
ModPagespeedEnableFilters rewrite_domains,rewrite_images
to my .htacess file, but I get the same result.
This are the uncommented lines on my pagespeed.conf file
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedInheritVHostConfig on
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
ModPagespeedFileCachePath "/var/cache/mod_pagespeed"
ModPagespeedLogDir "/var/log/pagespeed"
ModPagespeedSslCertDirectory "/etc/ssl/certs"
ModPagespeedCreateSharedMemoryMetadataCache "/var/cache/mod_pagespeed" 51200
ModPagespeedFileCacheInodeLimit 500000
ModPagespeedImagePreserveURLs on
ModPagespeedImageRecompressionQuality 95
ModPagespeedJpegRecompressionQuality -1
ModPagespeedWebpRecompressionQuality -1
<Location /pagespeed_admin>
Order allow,deny
Allow from localhost
Allow from 127.0.0.1
SetHandler pagespeed_admin
</Location>
<Location /pagespeed_global_admin>
Order allow,deny
Allow from localhost
Allow from 127.0.0.1
SetHandler pagespeed_global_admin
</Location>
ModPagespeedStatisticsLogging on
ModPagespeedMessageBufferSize 100000
</IfModule>
-Miguel
On 05/02/15 16:53, 'Joshua Marantz' via mod-pagespeed-discuss wrote:
> What else is in your pagespeed.conf file?
>
> Can you also try one more thing as well? Can you put all of these in the same .htaccess file:
> ModPagespeedRewriteLevel PassThrough
> ModPagespeedEnableFilters rewrite_domains,rewrite_images
> ModPagespeeedImagePreserveURLs on
>
> You might as well remove 'sprite_images' because if you are preserving image URLs then you certainly can't sprite them.
>
> On Thu, Feb 5, 2015 at 10:44 AM, Miguel Angel <
sku...@gmail.com <mailto:
sku...@gmail.com>> wrote:
>
> Yes,
>
> I have set
> ModPagespeedImagePreserveURLs on
> on the pagespeed.conf file that Apache is including and I have restarted Apache after that change.
>
> I configure pagespeed for my site using this on .htaccess:
>
> ModPagespeedDisableFilters inline_images,trim_urls,inline_css,
> ModPagespeedImageLimitOptimizedPercent 85
>
> ModPagespeedEnableFilters remove_comments,collapse_whitespace,outline_javascript,remove_quotes,combine_javascript,inline_google_font_css,flatten_css_imports,move_css_to_head,sprite_images,insert_dns_prefetch,collapse_whitespace,combine_heads,rewrite_javascript,convert_meta_tags,
>
> ModPagespeedShardDomain
www.mydomain.com <
http://www.mydomain.com>
static1.mydomain.com <
http://static1.mydomain.com>,
static2.mydomain.com <
http://static2.mydomain.com>,
static3.mydomain.com <
http://static3.mydomain.com>
> ModPagespeedShardDomain
www.example-cdn.com <
http://www.example-cdn.com>
www1.example-cdn.com <
http://www1.example-cdn.com>,
www2.example-cdn.com <
http://www2.example-cdn.com>,
www3.example-cdn.com <
http://www3.example-cdn.com>
>
> Should I report the bug or maybe I am missing something?
>
> -Miguel
>
> On 05/02/15 16:34, 'Joshua Marantz' via mod-pagespeed-discuss wrote:
> > Confirming: you have set
> > ModPagespeeedImagePreserveURLs on
> > and yet mod_pagespeed is still rewriting your img tag from
> > <img src="
http://www2.example-cdn.com/p_8997.jpg?f=resize(w=260,h=171) <
http://www2.example-cdn.com/p_8997.jpg?f=resize%28w=260,h=171%29> <
http://www2.example-cdn.com/xp_8997.jpg,qf=resize,28w=260,,h=171,29.pagespeed.ic.LEzFUQfmdx.webp>" alt="">
> > to
> > <img src="
http://www2.example-cdn.com/xp_8997.jpg,qf=resize,28w=260,,h=171,29.pagespeed.ic.LEzFUQfmdx.webp" alt="">
> >
> > If so that's a bug; can you report it?
> >
> > -Josh
> >
> > On Thu, Feb 5, 2015 at 10:27 AM, Miguel Angel <
sku...@gmail.com <mailto:
sku...@gmail.com> <mailto:
sku...@gmail.com <mailto:
sku...@gmail.com>>> wrote:
> >
> > Yeah, I checked before on DevTools.
> >
> > <img src="
http://www2.example-cdn.com/xp_8997.jpg,qf=resize,28w=260,,h=171,29.pagespeed.ic.LEzFUQfmdx.webp" alt="">
> >
> > This is one example coming directly from Chrome dev tools.
> >
> > I am not sure this is related but right now I am testing this configuration in my development machine with a VirtualHost configuration doing a proxy_pass to my cdn, I have disabled pagespeed on the Virtualhost declaration anyway, this is the config I am using on this VirtualHost.
> >
> > <VirtualHost *:80>
> > ServerName
www.example-cdn.com <
http://www.example-cdn.com> <
http://www.example-cdn.com>
> > ServerAlias
www1.example-cdn.com <
http://www1.example-cdn.com> <
http://www1.example-cdn.com>
www2.example-cdn.com <
http://www2.example-cdn.com> <
http://www2.example-cdn.com>
www3.example-cdn.com <
http://www3.example-cdn.com> <
http://www3.example-cdn.com>
> >
> > ServerAdmin
em...@email.com <mailto:
em...@email.com> <mailto:
em...@email.com <mailto:
em...@email.com>>
> > DocumentRoot /var/www/html
> >
> > ErrorLog ${APACHE_LOG_DIR}/error.cdn.log
> > CustomLog ${APACHE_LOG_DIR}/access.cdn.log combined
> >
> > ExpiresActive On
> > ExpiresByType image/gif "access plus 1 months"
> > ExpiresByType image/jpg "access plus 1 months"
> > ExpiresByType image/jpeg "access plus 1 months"
> > ExpiresByType image/png "access plus 1 months"
> > ExpiresByType image/x-icon "access plus 1 months"
> > ExpiresByType image/ico "access plus 1 months"
> > Header append Cache-Control "public"
> >
> > ModPagespeed off
> > ProxyPass /
http://real.cdn.com/_images/ retry=0 timeout=30
> > ProxyPassReverse /
http://real.cdn.com/_images/ timeout=30
> >
> > </VirtualHost>
> >
> > -Miguel
> >
> > On 05/02/15 16:08, 'Joshua Marantz' via mod-pagespeed-discuss wrote:
> > > You see that in the logs, but the URL leafs will not be changed. And if the sharded URLs are served by the CDN and not by mod_pagespeed, they shouldn't be resized.
> > >
> > > Check in the browser (chrome dev tools, firebug, or webpagetest).
> > >
> > > -Josh
> > >
> > > On Thu, Feb 5, 2015 at 10:05 AM, Miguel Rasero <
sku...@gmail.com <mailto:
sku...@gmail.com> <mailto:
sku...@gmail.com <mailto:
sku...@gmail.com>> <mailto:
sku...@gmail.com <mailto:
sku...@gmail.com> <mailto:
sku...@gmail.com <mailto:
sku...@gmail.com>>>> wrote:
> > >
> > > No, this combination doesn't work for me.
> > >
> > > Sharding works but rewrite_images modifies the cdn's coming images, I get this messages on the log:
> > > [Thu, 05 Feb 2015 15:01:19 GMT] [Info] [16043]
http://dev.mydomain.com/:1900: Shrinking image `
http://www.example-cdn.com/p_5321.jpg?f=resize(w=260,h=171) <
http://www.example-cdn.com/p_5321.jpg?f=resize%28w=260,h=171%29> <
http://www.example-cdn.com/p_5321.jpg?f=resize%28w=260,h=171%29> <
http://www.example-cdn.com/p_5321.jpg?f=resize%28w=260,h=171%29>' (7315 bytes) to `http:/
www2.example-cdn.com/xp_5321.jpg,qf=resize,28w=260,,h=171,29.pagespeed.ic.of7t6MOW9V.webp <
http://www2.example-cdn.com/xp_5321.jpg,qf=resize,28w=260,,h=171,29.pagespeed.ic.of7t6MOW9V.webp> <
http://www2.example-cdn.com/xp_5321.jpg,qf=resize,28w=260,,h=171,29.pagespeed.ic.of7t6MOW9V.webp> <
http://www2.example-cdn.com/xp_5321.jpg,qf=resize,28w=260,,h=171,29.pagespeed.ic.of7t6MOW9V.webp>' (5172 bytes)
> > >
> > > Miguel.
> > >
> > > On Thursday, February 5, 2015 at 3:49:35 PM UTC+1, jmarantz wrote:
> > >
> > > One other workaround you could try is this:
> > >
> > > ModPagespeedEnableFilters rewrite_domains,rewrite_images
> > > ModPagespeeedImagePreserveURLs on
> > >
> > > I think this might have most of the effect you want. It will compress images when requested as part of the original URL, but it will not change their URLs in the image rewrite filter. I believe it will still shard the domains of images though.
> > >
> > > I haven't tried it, but please let us know if this combination works.
> > > -Josh
> > >
> > > On Thu, Feb 5, 2015 at 9:45 AM, Miguel Rasero <
sku...@gmail.com <mailto:
sku...@gmail.com> <mailto:
sku...@gmail.com <mailto:
sku...@gmail.com>>> wrote:
> > >
> > > Ok, thank you Josh.
> > >
> > > In the meantime I will disable rewrite_images to be able to shard my cdn's images.
> > >
> > > Regards,
> > > Miguel Rasero.
> > >
> > > On Thursday, February 5, 2015 at 3:35:06 PM UTC+1, jmarantz wrote:
> > >
> > > I think you've stumbled into the limitations of PageSpeed's current configuration architecture. Basically, you need to express
> > > ModPagespeedEnableFilters rewrite_domains
> > > ModPagespeedEnableFilters rewrite_images -disallow
http://www.example-cdn.com <
http://www.example-cdn.com/>/*
> > > we don't have a mechanism in the code to support this, unfortunately. It is possible to do it, but it's not a small task and it's not something we could start anytime soon.
> > >
> > > I thought we already had a mod_pagespeed issue tracking this enhancement, but I don't see it. so I added
https://code.google.com/p/modpagespeed/issues/detail?id=1047
> > >
> > > -Josh
> > >
> > >
> > > On Thu, Feb 5, 2015 at 9:13 AM, Miguel Rasero <
sku...@gmail.com <mailto:
sku...@gmail.com> <mailto:
sku...@gmail.com <mailto:
sku...@gmail.com>>> wrote:
> > >
> > > Hello,
> > >
> > > I am using mod_pagespeed on Apache 2.4.7, everything is working fine but I don't know how to configure it to do what I want.
> > >
> > > I have one domain
www.mydomain.com <
http://www.mydomain.com> <
http://www.mydomain.com> <
http://www.mydomain.com> that I am sharding on
static1.mydomain.com <
http://static1.mydomain.com> <
http://static1.mydomain.com> <
http://static1.mydomain.com>,
static2.mydomain.com <
http://static2.mydomain.com> <
http://static2.mydomain.com> <
http://static2.mydomain.com>,
static3.mydomain.com <
http://static3.mydomain.com> <
http://static3.mydomain.com> <
http://static3.mydomain.com> and where I have rewrite_images enabled.
> > >
> > > I have another domain coming from a cdn provider
www.example-cdn.com <
http://www.example-cdn.com> <
http://www.example-cdn.com> <
http://www.example-cdn.com> that I use in my web at
www.mydomain.com <
http://www.mydomain.com> <
http://www.mydomain.com> <
http://www.mydomain.com>, for this cdn domain I am using ModPagespeedDisallow to avoid having pagespeed rewrite the images coming from that cdn.
> > >
> > > Ok, all of this is working fine, the problem is, How could I shard
www.example-cdn.com <
http://www.example-cdn.com> <
http://www.example-cdn.com> <
http://www.example-cdn.com> in my html if I don't want to rewrite images coming from the cdn but I want to rewrite_images on my own domain?
> > >
> > > The problem I find it is that if I use ModPagespeedDisallow
www.example-cdn.com <
http://www.example-cdn.com> <
http://www.example-cdn.com> <
http://www.example-cdn.com> I can't shard access to it and if I delete this disallow all the cdn's coming images will be rewritten if these images can be improved by pagespeed.
> > >
> > > Regards,
> > > Miguel Rasero.
> > >
> > >
> > > --
> > >
> > > --
> > > 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 <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com> <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com <mailto:
mod-pagespeed-discuss%252Buns...@googlegroups.com>> <mailto:
mod-pagespeed-di...@googlegroups.com <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com> <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com <mailto:
mod-pagespeed-discuss%252Buns...@googlegroups.com>>>.
> > > To unsubscribe from this group and all its topics, send an email to
mod-pagespeed-di...@googlegroups.com <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com> <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com <mailto:
mod-pagespeed-discuss%252Buns...@googlegroups.com>> <mailto:
mod-pagespeed-di...@googlegroups.com <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com> <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com <mailto:
mod-pagespeed-discuss%252Buns...@googlegroups.com>>>.
> > To unsubscribe from this group and stop receiving emails from it, send an email to
mod-pagespeed-di...@googlegroups.com <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com> <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com <mailto:
mod-pagespeed-discuss%252Buns...@googlegroups.com>>.
> > To unsubscribe from this group and all its topics, send an email to
mod-pagespeed-di...@googlegroups.com <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com> <mailto:
mod-pagespeed-di...@googlegroups.com <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com>>.
> To unsubscribe from this group and stop receiving emails from it, send an email to
mod-pagespeed-di...@googlegroups.com <mailto:
mod-pagespeed-discuss%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAGKR%2BEApJ4HBU-FJt_LbBOXWLXzz4Fqmy9LSsRG7XDH_9WEX%2Bg%40mail.gmail.com <
https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAGKR%2BEApJ4HBU-FJt_LbBOXWLXzz4Fqmy9LSsRG7XDH_9WEX%2Bg%40mail.gmail.com?utm_medium=email&utm_source=footer>.