Which filter is rewriting the image names?

28 views
Skip to first unread message

MikeD

unread,
Mar 16, 2011, 5:27:56 PM3/16/11
to mod-pagespeed-discuss
I have noticed that image files are being rewritten, for no apparent
reason. For example:
012o-0098-066.jpg
is being rewritten as
012o-0098-066.jpg.pagespeed.ce.Yu7JkeEAqV.jpg

Note that

ModPagespeedDisableFilters rewrite_images

is set. So all the extra stuff just adds bytes on to my requests, and
will ruin the image links that are in google images.

Which filter do I have to disable to make this stop?

...Mike

Joshua Marantz

unread,
Mar 16, 2011, 5:35:45 PM3/16/11
to mod-pagesp...@googlegroups.com, MikeD
On Wed, Mar 16, 2011 at 5:27 PM, MikeD <photos...@gmail.com> wrote:
I have noticed that image files are being rewritten, for no apparent
reason. For example:
  012o-0098-066.jpg
is being rewritten as
  012o-0098-066.jpg.pagespeed.ce.Yu7JkeEAqV.jpg

Most likely the reason was that mod_pagespeed believed it could cache your image for a longer period of time, without compromising your ability to change it, by embedding a content-hash in your URL.  mod_pagespeed will extend the cache lifetime of resources cached for less than a month.  It extends the lifetime to 1 year.

I don't see why it would ruin the image links in Google Images -- the original image links will still work.
 
ModPagespeedDisableFilters rewrite_images

is set. So all the extra stuff just adds bytes on to my requests, and
will ruin the image links that are in google images.

Which filter do I have to disable to make this stop?

You can make it leave all jpg files alone with

  ModPagespeedDisallow *.jpg

Sorry about that directive not applying to trim_urls, but it will apply to cache-extension -- we'll enter a bug for the trim_urls issue.

-Josh

Shawn Ligocki

unread,
Mar 16, 2011, 5:42:49 PM3/16/11
to mod-pagesp...@googlegroups.com, MikeD
This is from the extend_cache filter. It extends the cache lifetimes of resources. You can disable all rewriting of images with:

ModPagespeedDisallow *.jpg
ModPagespeedDisallow *.png
...

-Shawn


On Wed, Mar 16, 2011 at 5:27 PM, MikeD <photos...@gmail.com> wrote:

MikeD

unread,
Mar 16, 2011, 5:41:05 PM3/16/11
to mod-pagespeed-discuss
Thanks Josh. It's a pretty sweet mod, and I'm keep to use it...just
wanted to make sure I understood correctly. You're right: the google
images thing isn't true since the original file is still
accessible...my mistake. I've put in the chunk you suggested, and
images are back to normal, thanks.

The great reason for open testing is to find issues, so I'm glad to
have found one for you (the trim_urls thing).

Thanks!

...Mike

On Mar 16, 5:35 pm, Joshua Marantz <jmara...@google.com> wrote:
Reply all
Reply to author
Forward
0 new messages