New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ModPagespeedMapProxyDomain to CDN #599

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 67 comments

Comments

Projects
None yet
5 participants
@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Apr 6, 2015

Currently I believe it is difficult to configure mod_pagespeed to take an 
externally-hosted resource, optimize it, and map it to a CDN.


Original message:


From Kim Frederiksen kim@olicity.com via googlegroups.com 
12/22/12 (11 days ago)


I have successfully configured the following directive using a subdomain, as it 
seems using a main domain with a WordPress .htaccess is not working. My 
directive is as follows:

ModPagespeedMapProxyDomain http://p.djoystick.com/proxyimages0 
http://distilleryimage0.s3.amazonaws.com

My question is, as I tried to after this directive using: 

ModPagespeedMapRewriteDomain http://pscdn.djoystick.com http://p.djoystick.com

Where pscdn.djoystick.com is a CNAME pointing to my CDN, using origin pull from 
p.djoystick.com

My hopes were to first proxy the resource, then use origin pull from my CDN to 
store the ressource in it's optimized form on the CDN.

Is that not possible, or am I making a flawed configuration? Also, what would 
you recommend in terms of using the original domain as the proxy instead of a 
subdomain under a wordpress root installation having .htaccess in that 
installation rewrite everything?

Original issue reported on code.google.com by jmara...@google.com on 2 Jan 2013 at 2:31

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

The transitive mapping you specified isn't going to work. Ideally you should be 
able to map it directly to the CDN with:
    ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages0 http://distilleryimage0.s3.amazonaws.com

But I think there is a problem.  The CDN will then send the origin request to 
some reference domain you specify in the CDN configuration, but mod_pagespeed 
will not be able to correctly route that request back to 
http://distilleryimage0.s3.amazonaws.com, so the above won't work.

Until I'm back at my desk I have something for you to try, which is to try an 
exact transitive mapping:

ModPagespeedMapProxyDomain http://p.djoystick.com/proxyimages0 
http://distilleryimage0.s3.amazonaws.com
ModPagespeedMapRewriteDomain http://pscdn.djoystick.com/proxyimages0 
http://p.djoystick.com/proxyimages0

I think if you use the exact same directories (rather than subdirectories) the 
transitive mapping should occur.  It's worth a try but I have to admit we did 
not test this configuration so it might need a small code tweak after the new 
year.  It's worth a try though.  There's a chance that with this transitive 
configuration we will send the wrong Host header to 
http://distilleryimage0.s3.amazonaws.com, but let us know how it turns out.

Original comment by jmara...@google.com on 2 Jan 2013 at 2:32

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Original comment by jmara...@google.com on 3 Jan 2013 at 7:59

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Well, bottom line is, I might not be on the right path here, but if I am, this 
makes complete sense. As we not only avoid extra DNS lookups, we get assets 
optimized optimally as well as hosted on the best CDN of our particular choice. 
So unless there is an alternativ that I have not thought about, I think this 
feature should be obvious. Let me know what I can do to help.

Thanks,

Kim

Original comment by onl...@olicity.com on 6 Jan 2013 at 8:53

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Hi Kim.  Have you had any success with the possible solution suggested by 
jmarantz?  It would be helpful to know if that works.

Original comment by jkar...@google.com on 7 Jan 2013 at 11:35

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Don't worry about jmarantz's suggestion, the transitive mapping won't work.  
I'm working on a solution.

Original comment by jkar...@google.com on 10 Jan 2013 at 1:22

  • Changed state: Started
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Kim,

Could you try putting the following in your configuration?  It should work for 
your needs.  Please let me know if it does.

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages0 
http://distilleryimage0.s3.amazonaws.com

ModPagespeedMapOriginDomain http://distilleryimage0.s3.amazonaws.com 
http://p.djoystick.com/proxyimages0

Original comment by jkar...@google.com on 28 Jan 2013 at 1:41

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

The technique is working :-) The only problem remaining is that the first pull 
has a broken resource referenced, which means that only optimized resources 
work with ModPagespeedMapProxyDomain, this seems only to be the case for images 
though. JS files seems to work just fine on the first pull.

Picking a random DJ from this list should do the trick: 
http://djoystick.com/dj-listings/

Thanks a lot.

Kim

Original comment by kimfr...@olicity.com on 30 Jan 2013 at 8:01

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Hi Kim,

Very glad that it's working.  We're working on making this an option in 
ModPagespeedMapProxyDomain so that the extra configuration won't be necessary 
in the future.

You should also add the following line to your configuration, it will prevent 
some redundant rewrites from occuring:
ModPagespeedMapRewriteDomain http://pscdn.djoystick.com/proxyimages0 
http://p.djoystick.com/proxyimages0

I don't understand what you mean by the first pull having a broken reference.  
Could you provide more detail?

Original comment by jkar...@google.com on 30 Jan 2013 at 11:38

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Kim: are you using the 'rewrite_domains' filter?

I think we have an issue with rewrite_domains & ModPagespeedMapProxyDomain.  We 
have to either make rewrite_domains avoid mapping unoptimized resources to 
proxies, or we have to add general proxy serving to mod_pagespeed.  I have a 
prototype of the latter as a proof of concept, but we haven't made a decision 
about it yet.

In the meantime, please let us know if that first-view-error goes away if you 
turn off rewrite_domains.

Original comment by jmara...@google.com on 31 Jan 2013 at 7:19

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

See Issue 615

Original comment by jmara...@google.com on 31 Jan 2013 at 7:22

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

To clarify, rewrite_domains was not turned on, turning it on yields the same 
result.

The problem is that when the resource is not yet optimized and the reference in 
the IMG tag is eg. 

http://pscdn.djoystick.com/proxyimages5/w8a855b3a6a3e11e2b39e22000a9d0df1_5.jpg

That load fails and shows a broken image in the browser. On the second load, 
which has the following reference in the IMG tag, everything is dandy.

http://pscdn.djoystick.com/proxyimages5/w8a855b3a6a3e11e2b39e22000a9d0df1_5.jpg.
pagespeed.ic.gTKx1yi9-9.webp

Hope that clarified things. As I said, for some reason this does not seem to be 
the case on .js or .css files under the same  rewriting scenario.

Remember, this is of course also only a problem when using the tactic you 
provided for the proxy to CDN.

Thanks again,

Kim

Original comment by kimfr...@olicity.com on 1 Feb 2013 at 5:15

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Thanks for the clarification Kim. I'll try to reproduce and fix that problem.

Original comment by jkar...@google.com on 1 Feb 2013 at 5:30

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Just to be clear, the img tag is originally something like this, right?
  <img src="http://distilleryimage0.s3.amazonaws.com/w8a855b3a6a3e11e2b39e22000a9d0df1_5.jpg"></img>

The only thing I'm aware of that can move that to 
http://pscdn.djoystick.com/proxyimages5 is rewrite_domains.

OR do you actually have 

http://pscdn.djoystick.com/proxyimages5/w8a855b3a6a3e11e2b39e22000a9d0df1_5.jpg

in your original markup?

Original comment by jmara...@google.com on 1 Feb 2013 at 5:37

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Well, here is the part of my config that should clarify everything. Short 
answer is yes, it is the distillery URL to begin with:

    ModPagespeedEnableFilters remove_comments,collapse_whitespace
    ModPagespeedEnableFilters rewrite_javascript,combine_javascript
    ModPagespeedEnableFilters move_css_to_head,move_css_above_scripts
    ModPagespeedEnableFilters convert_jpeg_to_webp
    ModPagespeedEnableFilters rewrite_css
    ModPagespeedEnableFilters rewrite_domains,trim_urls
    ModPagespeedEnableFilters outline_css
    # ModPagespeedEnableFilters local_storage_cache
    ModPagespeedEnableFilters canonicalize_javascript_libraries
    ModPagespeedEnableFilters insert_dns_prefetch

    # ModPagespeedDomain
    # authorizes rewriting of JS, CSS, and Image files found in this
    # domain. By default only resources with the same origin as the
    # HTML file are rewritten. For example:
    #
    #   ModPagespeedDomain cdn.myhost.com
    #
    # This will allow resources found on http://cdn.myhost.com to be
    # rewritten in addition to those in the same domain as the HTML.
    #
    # Wildcards (* and ?) are allowed in the domain specification. Be
    # careful when using them as if you rewrite domains that do not
    # send you traffic, then the site receiving the traffic will not
    # know how to serve the rewritten content.

    ModPagespeedDomain http://scdn.*.com
    ModPagespeedDomain http://scdn1.*.com
    ModPagespeedDomain http://scdn2.*.com
    ModPagespeedDomain http://scdn3.*.com
    ModPagespeedDomain http://scdn4.*.com

    ModPagespeedDomain http://pscdn.djoystick.com
    ModPagespeedDomain http://p.djoystick.com

    ModPagespeedDisallow */wp-admin/*
    ModPagespeedAllow */wp-admin/admin-ajax.php

    ModPagespeedDisallow *callrail*

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages0 
http://distilleryimage0.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage0.s3.amazonaws.com 
http://p.djoystick.com/proxyimages0

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages1 
http://distilleryimage1.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage1.s3.amazonaws.com 
http://p.djoystick.com/proxyimages1

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages2 
http://distilleryimage2.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage2.s3.amazonaws.com 
http://p.djoystick.com/proxyimages2

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages3 
http://distilleryimage3.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage3.s3.amazonaws.com 
http://p.djoystick.com/proxyimages3

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages4 
http://distilleryimage4.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage4.s3.amazonaws.com 
http://p.djoystick.com/proxyimages4

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages5 
http://distilleryimage5.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage5.s3.amazonaws.com 
http://p.djoystick.com/proxyimages5

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages6 
http://distilleryimage6.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage6.s3.amazonaws.com 
http://p.djoystick.com/proxyimages6

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages7 
http://distilleryimage7.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage7.s3.amazonaws.com 
http://p.djoystick.com/proxyimages7

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages8 
http://distilleryimage8.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage8.s3.amazonaws.com 
http://p.djoystick.com/proxyimages8

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/fastfonts/cssapi 
http://fast.fonts.com/cssapi/
ModPagespeedMapOriginDomain http://fast.fonts.com/cssapi/ 
http://p.djoystick.com/fastfonts/cssapi

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/socialize 
http://djoystick.api.oneall.com/socialize/
ModPagespeedMapOriginDomain http://djoystick.api.oneall.com/socialize/ 
http://p.djoystick.com/socialize

ModPagespeedMapRewriteDomain pscdn.djoystick.com p.djoystick.com

Original comment by jis...@livedeal.com on 1 Feb 2013 at 5:45

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Sorry, I was using the wrong account.

Well, here is the part of my config that should clarify everything. Short 
answer is yes, it is the distillery URL to begin with:

    ModPagespeedEnableFilters remove_comments,collapse_whitespace
    ModPagespeedEnableFilters rewrite_javascript,combine_javascript
    ModPagespeedEnableFilters move_css_to_head,move_css_above_scripts
    ModPagespeedEnableFilters convert_jpeg_to_webp
    ModPagespeedEnableFilters rewrite_css
    ModPagespeedEnableFilters rewrite_domains,trim_urls
    ModPagespeedEnableFilters outline_css
    # ModPagespeedEnableFilters local_storage_cache
    ModPagespeedEnableFilters canonicalize_javascript_libraries
    ModPagespeedEnableFilters insert_dns_prefetch

    # ModPagespeedDomain
    # authorizes rewriting of JS, CSS, and Image files found in this
    # domain. By default only resources with the same origin as the
    # HTML file are rewritten. For example:
    #
    #   ModPagespeedDomain cdn.myhost.com
    #
    # This will allow resources found on http://cdn.myhost.com to be
    # rewritten in addition to those in the same domain as the HTML.
    #
    # Wildcards (* and ?) are allowed in the domain specification. Be
    # careful when using them as if you rewrite domains that do not
    # send you traffic, then the site receiving the traffic will not
    # know how to serve the rewritten content.

    ModPagespeedDomain http://scdn.*.com
    ModPagespeedDomain http://scdn1.*.com
    ModPagespeedDomain http://scdn2.*.com
    ModPagespeedDomain http://scdn3.*.com
    ModPagespeedDomain http://scdn4.*.com

    ModPagespeedDomain http://pscdn.djoystick.com
    ModPagespeedDomain http://p.djoystick.com

    ModPagespeedDisallow */wp-admin/*
    ModPagespeedAllow */wp-admin/admin-ajax.php

    ModPagespeedDisallow *callrail*

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages0 
http://distilleryimage0.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage0.s3.amazonaws.com 
http://p.djoystick.com/proxyimages0

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages1 
http://distilleryimage1.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage1.s3.amazonaws.com 
http://p.djoystick.com/proxyimages1

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages2 
http://distilleryimage2.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage2.s3.amazonaws.com 
http://p.djoystick.com/proxyimages2

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages3 
http://distilleryimage3.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage3.s3.amazonaws.com 
http://p.djoystick.com/proxyimages3

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages4 
http://distilleryimage4.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage4.s3.amazonaws.com 
http://p.djoystick.com/proxyimages4

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages5 
http://distilleryimage5.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage5.s3.amazonaws.com 
http://p.djoystick.com/proxyimages5

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages6 
http://distilleryimage6.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage6.s3.amazonaws.com 
http://p.djoystick.com/proxyimages6

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages7 
http://distilleryimage7.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage7.s3.amazonaws.com 
http://p.djoystick.com/proxyimages7

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/proxyimages8 
http://distilleryimage8.s3.amazonaws.com
ModPagespeedMapOriginDomain http://distilleryimage8.s3.amazonaws.com 
http://p.djoystick.com/proxyimages8

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/fastfonts/cssapi 
http://fast.fonts.com/cssapi/
ModPagespeedMapOriginDomain http://fast.fonts.com/cssapi/ 
http://p.djoystick.com/fastfonts/cssapi

ModPagespeedMapProxyDomain http://pscdn.djoystick.com/socialize 
http://djoystick.api.oneall.com/socialize/
ModPagespeedMapOriginDomain http://djoystick.api.oneall.com/socialize/ 
http://p.djoystick.com/socialize

ModPagespeedMapRewriteDomain pscdn.djoystick.com p.djoystick.com

Original comment by kimfr...@olicity.com on 1 Feb 2013 at 5:47

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

I see "rewrite_domains" in there, at least right now.  Can you check whether 
the first-load problem goes away when you remove it & restart?

Original comment by jmara...@google.com on 1 Feb 2013 at 5:59

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Hi Kim,

Any word on jmarantz's question?  It would be very helpful for us to figure out 
what's not working for your site.

Thanks,

Josh

Original comment by jkar...@google.com on 11 Feb 2013 at 12:27

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Closing this.  From Kim in a response to the release email with the new three 
argument MapProxyDomain:

Hi everyone.

Thanks for updating this awesome module once again. I can confirm that the 
issue I was involved in, Issue 599 Support ModPagespeedMapProxyDomain to 
CDN is working perfectly, and seems to be working as well not even adding 
any additional domains into the mix, meaning I can utilize the same CDN 
domain and the same source domain, minimizing my DNS lookups as well as 
overall speeding up the site transfer. I see a significant increase using 
our own CDN once items are optimized. Also the first pull problem is gone 
making this work exactly like I wanted it.

Again, thanks.


Original comment by jkar...@google.com on 20 Feb 2013 at 2:29

  • Changed state: Verified
  • Added labels: Milestone-v25, release-note
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Thank you to All who have participated in this group discussion about the 
mod_pagespeed issue within amazon cdn.

Subject: Iam using mod_pagespeed in My Apache Server, Amazon CDN not working 
after proper configuration.

Please help me out in this issue.

My Amazon CDN details:

Domain Name : dtgxnog5a4zcn.cloudfront.net

Origin : vookster.s3.amazonaws.com

CNAMEs: cdn.vookster.com


Waiting for your Reply

Best Regards
G.Laxmana Rao





Original comment by vookste...@gmail.com on 27 Jul 2013 at 3:43

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

(vookster) is my Amazon cdn bucket name 
https://s3-ap-southeast-1.amazonaws.com/vookster

Amazon cdn original path: 
https://s3-ap-southeast-1.amazonaws.com/vookster/file/pic/photo/000d0c74074191ad
d6f22e0004db8f76.jpg


Best Regards
G.Laxmana Rao

Original comment by vookste...@gmail.com on 27 Jul 2013 at 4:06

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Hi Vookster,

Are you trying to optimize the site vookster.s3.amazonaws.com ?

That page appears to be an XML document.  mod_pagespeed only optimizes HTML.

Josh

Original comment by jkar...@google.com on 5 Aug 2013 at 11:02

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Are you trying to optimize the site vookster.s3.amazonaws.com ?
Reply>> vookster.s3.amazonaws.com is my bucket name.

just like above post:

ModPagespeedMapProxyDomain http://p.djoystick.com/proxyimages0 
http://distilleryimage0.s3.amazonaws.com

=============================================================
mine should be like this
ModPagespeedMapProxyDomain http://cdn.vookster.com 
http://vookster.s3.amazonaws.com

Note:

I am not trying to optimize xml, Iam trying to optimize my site images hosted 
at amazon cloud.


Please give solution for this

Original comment by vookste...@gmail.com on 22 Oct 2013 at 9:29

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Can you describe what is not working?  Can you provide an example webpage for 
me to diagnose?

Thanks!

Josh

Original comment by jkar...@google.com on 22 Oct 2013 at 10:43

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

But still cdn images not loading with pagespeed :(

Original comment by vookste...@gmail.com on 22 Oct 2013 at 11:28

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Your origin server (www.vookster.com) is rewriting the images that it sees at 
your cdn.vookster.com subdomain and putting those urls into the document, like: 
http://cdn.vookster.com/file/pic/video/2013/07/120x90xdcf6070a4ab7f3afbfd2809173
e0824b_120.jpg.pagespeed.ic.RmeMv0ieKs.webp

Those rewritten urls will only work if your cdn domain can properly pull the 
resources from your origin.  Can your cdn pull the rewritten resources from 
your origin?  If you have a push cdn, then I don't believe mod_pagespeed can be 
used to rewrite your images.

Original comment by jkar...@google.com on 23 Oct 2013 at 12:08

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

How to check whether the cdn pull the rewritten resources?
Please assist me. 

Original comment by vookste...@gmail.com on 23 Oct 2013 at 3:48

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Still we have issues. Two images 

http://www.vookster.com/video

Current Pagespeed.conf:
=======================

ModPagespeedDomain http://cdn.vookster.com
ModPagespeedMapProxyDomain  http://ww.vookster.com/awsproxy 
http://vookster.s3.amazonaws.com http://cdn.vookster.com/awsproxy

URL : 
http://cdn.vookster.com/file/pic/video/2013/07/120x90xdcf6070a4ab7f3afbfd2809173
e0824b_120.jpg.pagespeed.ic.RmeMv0ieKs.webp

Shows image is optimized by pagespeed. But not the other images. 

Can someone help ?

Original comment by vookste...@gmail.com on 23 Oct 2013 at 1:12

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Here is my understanding of your situation:

1) You have www.vookster.com/video and it has many links to resources on 
cdn.vookster.com

2) You would like the resources on cdn.vookster.com to be optimized by 
pagespeed.

Is this correct?

If so, what you need to do is:

1) Configure your cdn (amazon cloud front in this case) to pull with 
www.vookster.com as the origin so that the cdn knows where to get the optimized 
files from.

2) Authorize cdn.vookster.com in your pagespeed.conf with "ModPagespeedDomain 
http://cdn.vookster.com".  You do not need to use ModPagespeedMapProxyDomain.

The reason that you're seeing some images optimized is because pagespeed is 
inlining the tiny images into the page directly, and creating newly optimized 
resources with cdn.vookster.com addresses for the rest, but cdn.vookster.com 
does not know how to properly pull the resources from www.vookster.com.


Original comment by jkar...@google.com on 23 Oct 2013 at 1:43

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Thank you for reply,

I have configure as my amazon cloudfront pull with origin as (www.vookster.com).

Cloudfront distribution Domain:  dtgxnog5a4zcn.cloudfront.net.

Cloudfront (CNAMEs):Domain Names: (cdn.vookster.com).

Cloudfront origin is (www.vookster.com).

Now guide us how to configure mod_pagespeed in our server.




Original comment by vookste...@gmail.com on 23 Oct 2013 at 3:05

Attachments:

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

We have updated the pagespeed configuration file, but still the image is not 
showing while we accessing the link: 
http://cdn.vookster.com/file/pic/video/2013/07/120x90xb090409688550f3cc93f4ed88e
c6cafb_120.jpg.pagespeed.ic.oxezxMFtHy.jpg

Instead of showing image, it shows "Apache server with mod_pagespeed
OKNOT 
FOUND:http://www.vookster.com/file/pic/video/2013/07/120x90xb090409688550f3cc93f
4ed88ec6cafb_120.jpg.pagespeed.ic.oxezxMFtHy.jpg" 

Please advise us to proceed..

Original comment by vookste...@gmail.com on 24 Oct 2013 at 8:34

Attachments:

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Do your Apache logs say anything about why those images are failing?  

Original comment by jkar...@google.com on 24 Oct 2013 at 11:08

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

No Errors related why images are failing?

Original comment by vookste...@gmail.com on 24 Oct 2013 at 11:37

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

The fact that the .pagespeed. resource fails led me to unwind the encoding and 
try this: 

wget 
http://www.vookster.com/file/pic/video/2013/07/b090409688550f3cc93f4ed88ec6cafb_
120.jpg

which actually succeeds.  And now I'm wondering why that is, because I'd have 
expected the pagespeed resource to succeed if the raw resource does.  Do you 
use mod_rewrite on your site to serve that image?

It would be great to look at your Apache error logs to see if there's something 
relevant there.

Original comment by jmara...@google.com on 24 Oct 2013 at 12:10

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

When I fetch that file there is no X-Mod-Pagespeed header returned, which means 
either you do not have mod_pagespeed installed/enabled or for some reason you 
are stripping out headers:

$ wget -S -O /dev/null 
'http://www.vookster.com/file/pic/video/2013/07/b090409688550f3cc93f4ed88ec6cafb
_120.jpg'
--2013-10-24 09:08:54--  
http://www.vookster.com/file/pic/video/2013/07/b090409688550f3cc93f4ed88ec6cafb_
120.jpg
Resolving www.vookster.com (www.vookster.com)... 192.198.207.84
Connecting to www.vookster.com (www.vookster.com)|192.198.207.84|:80... 
connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Date: Thu, 24 Oct 2013 13:08:54 GMT
  Server: Apache/2.2.25 (Unix) mod_ssl/2.2.25 OpenSSL/1.0.0-fips mod_bwlimited/1.4 PHP/5.3.26
  Last-Modified: Mon, 31 Aug 2009 00:00:00 GMT
  Accept-Ranges: bytes
  Content-Length: 3331
  Cache-Control: max-age=2592000, public
  Expires: Thu, 15 Sep 2020 20:00:00 GMT
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: image/jpeg
Length: 3331 (3.3K) [image/jpeg]
Saving to: `/dev/null'

100%[=====================================>] 3,331       --.-K/s   in 0s      

2013-10-24 09:08:54 (349 MB/s) - `/dev/null' saved [3331/3331]

Original comment by matterb...@google.com on 24 Oct 2013 at 1:11

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

It seems like mod_pagespeed is unable to fetch the original jpg file from 
localhost when it gets the .pagespeed. request.  That kind of error should show 
up in your Apache error logs.

I just did a request for: 
http://www.vookster.com/file/pic/video/2013/07/thisisatestformodpagespeed.jpg.pa
gespeed.ce.0.jpg 

Can you search your logs for "thisisatestformodpagespeed" to see if that's 
mentioned in there?

Original comment by jkar...@google.com on 24 Oct 2013 at 2:21

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Yes we have enable mod_rewrite. We see more redirect to the page which we 
access. 

Original comment by vookste...@gmail.com on 24 Oct 2013 at 2:51

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Actually this whole comment stream has gotten off topic of this bug, which was 
closed long ago.

Please put follow-up comments in Issue 808.

Original comment by jmara...@google.com on 24 Oct 2013 at 3:04

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Hello 

      I am also facing some issue regarding the modpagespeed pls help me any one 


my site working with amazon elastic beanstalk here my images are kept under the 
s3 bucket. i used cloud front to serve the images i tried to rewrite the image 
to compress but it not working 

my ec2 instance are working behind the  loadbalancer with out the loadbalancer 
my configuration was worked. i am giving you the configuration which i was used 
pls help  any one to solve the issue 

  ModPagespeedDomain cdn.example.com
   #ModPagespeedEnableFilters rewrite_images
   #iModPagespeedEnableFilters lazyload_images
   #ModPagespeedEnableFilters rewrite_images
   ModPagespeedMapProxyDomain  http://www.example.com/images https://s3-ap-southeast-1.amazonaws.com/images
   ModPagespeedShardDomain http://www.example.com  http://cdn.example.com


This configuration working fine for me with out loadbalancer but when it was 
applied on behind the load balancer it is not working. so i tried with 
ModPagespeedMapOriginDomain  http://localhost http://www.example.com
but not working pls help me any to solve the issue 

Original comment by aneesh...@gmail.com on 19 Mar 2014 at 1:35

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Hi,

We again experiencing issues with images with CDN are not optimizing through 
pagespeed. We have already followed the configuration setup as discussed in 
this forum, but still no luck.

Provided below the pagespeed configuration file:

=========

root@hosted-by [/usr/local/apache/conf]# cat pagespeed.conf
LoadModule pagespeed_module modules/mod_pagespeed.so
<IfModule pagespeed_module>
    ModPagespeed on
ModPagespeedFetchWithGzip on
SetOutputFilter DEFLATE

    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

ModPagespeedFileCachePath            "/var/mod_pagespeed/cache/"
#ModPagespeedGeneratedFilePrefix      "/var/mod_pagespeed/files/"

ModPagespeedRewriteLevel PassThrough

ModPagespeedFileCacheSizeKb          102400
ModPagespeedFileCacheCleanIntervalMs 3600000
ModPagespeedLRUCacheKbPerProcess     1024
ModPagespeedLRUCacheByteLimit        16384
ModPagespeedCssInlineMaxBytes        2048
ModPagespeedImageInlineMaxBytes      2048
ModPagespeedCssImageInlineMaxBytes   2048
ModPagespeedJsInlineMaxBytes         2048
ModPagespeedCssOutlineMinBytes       3000
ModPagespeedJsOutlineMinBytes        3000

ModPagespeedDomain http://cdn.vookster.com

ModPagespeedEnableFilters 
extend_cache,combine_css,move_css_to_head,rewrite_javascript,rewrite_images,add_
head,rewrite_css,collapse_whitespace,remove_comments,remove_quotes,sprite_images
,convert_meta_tags

ModPagespeedRespectVary on

    <Location /mod_pagespeed_beacon>
          SetHandler mod_pagespeed_beacon
    </Location>

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

    ModPagespeedMessageBufferSize 100000
    <Location /mod_pagespeed_message>
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_message
    </Location>
    <Location /mod_pagespeed_referer_statistics>
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler mod_pagespeed_referer_statistics
    </Location>
</IfModule>


# Filters for image optimization:
ModPagespeedEnableFilters convert_jpeg_to_progressive
ModPagespeedEnableFilters convert_png_to_jpeg
ModPagespeedEnableFilters convert_jpeg_to_webp
ModPagespeedEnableFilters insert_image_dimensions
ModPagespeedEnableFilters inline_images
ModPagespeedEnableFilters recompress_images
ModPagespeedEnableFilters resize_images
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters inline_preview_images
ModPagespeedEnableFilters resize_mobile_images
ModPagespeedEnableFilters lazyload_images
ModPagespeedEnableFilters insert_img_dimensions
ModPagespeedEnableFilters recompress_jpeg
ModPagespeedEnableFilters recompress_png
ModPagespeedEnableFilters recompress_webp
ModPagespeedEnableFilters strip_image_color_profile
ModPagespeedEnableFilters strip_image_meta_data

ModPagespeedEnableFilters inline_preview_images

ModPagespeedEnableFilters convert_gif_to_png
ModPagespeedEnableFilters jpeg_subsampling
ModPagespeedEnableFilters convert_to_webp_lossless


# Java and CSS Optimization core filters:
ModPagespeedEnableFilters defer_javascript
ModPagespeedEnableFilters rewrite_css
ModPagespeedEnableFilters combine_css
ModPagespeedEnableFilters inline_css
ModPagespeedEnableFilters combine_javascript
ModPagespeedEnableFilters inline_javascript
ModPagespeedEnableFilters move_css_above_scripts
ModPagespeedEnableFilters rewrite_css,sprite_images
ModPagespeedEnableFilters rewrite_css
ModPagespeedEnableFilters rewrite_javascript
ModPagespeedEnableFilters flatten_css_imports
ModPagespeedEnableFilters move_css_to_head

# Filters for Others and html optimization:
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters remove_quotes
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters trim_urls
ModPagespeedEnableFilters canonicalize_javascript_libraries
ModPagespeedEnableFilters insert_dns_prefetch
ModPagespeedEnableFilters add_head
ModPagespeedEnableFilters convert_meta_tags
ModPagespeedEnableFilters rewrite_style_attributes_with_url
ModPagespeedEnableFilters inline_import_to_link
ModPagespeedEnableFilters  fallback_rewrite_css_urls
ModPagespeedEnableFilters make_google_analytics_async
ModPagespeedEnableFilters elide_attributes

#ModPagespeedEnableFilters prioritize_critical_css

# Settings for image optimization:
ModPagespeedImageRecompressionQuality 72
ModPagespeedJpegRecompressionQuality 72
#ModPagespeedWebpRecompressionQuality 72


# Ensure minimum savings
ModPagespeedImageLimitOptimizedPercent 72
ModPagespeedImageLimitResizeAreaPercent 50

#Disallow admincp of vookster:
ModPagespeedAllow wildcard_spec
ModPagespeedDisallow "*/satyavathi/*"

================

cdn.vookster.com CNAME dtgxnog5a4zcn.cloudfront.net.

http://vookster.com/photo -> images under trouble

Can you please look into the trouble.

Thank You.



Original comment by vookste...@gmail.com on 13 May 2014 at 9:15

@binir

This comment has been minimized.

Copy link

binir commented Feb 3, 2016

I have too configured mod_pagespeed to take an externally-hosted resource for optimizing and mapping it to a CDN. Problem is only the .css are getting combined and optimized whereas there is no effect on .js files.

Filters enabled are configuration added is as follows:

ModPagespeedRewriteLevel PassThrough

ModPagespeedEnableFilters combine_css,extend_cache,rewrite_images,combine_javascript
ModPagespeedEnableFilters rewrite_css,rewrite_javascript
ModPagespeedEnableFilters inline_css,inline_javascript,rewrite_javascript_inline
ModPagespeedEnableFilters rewrite_javascript_external,rewrite_javascript_inline,outline_javascript

Is something missing in the configuration?

@oschaaf

This comment has been minimized.

Copy link
Member

oschaaf commented Feb 3, 2016

@binir Are the involved js files served as cacheable? If PageSpeed sees cache-control headers such as nocache or private it will not optimize.

@binir

This comment has been minimized.

Copy link

binir commented Feb 3, 2016

Yes cache-control header was private. Changed to public and its working now.
Thank you.

@aelsharawi

This comment has been minimized.

Copy link

aelsharawi commented May 15, 2016

Hi

I m using Nginx, and my website is under https

I use these setting but looks like it is not working

######## ADD CDN


pagespeed MapRewriteDomain https://mydomain https://wordpresscdn.azureedge.net;

pagespeed ShardDomain https://mydomain https://wordpresscdn.azureedge.net;
pagespeed MapProxyDomain https://mydomain/wp-content https://wordpresscdn.azureedge.net/wp-content;
pagespeed Domain https://wordpresscdn.azureedge.net;
#####

please help me

@jmarantz

This comment has been minimized.

Copy link
Contributor

jmarantz commented May 16, 2016

If I'm inferring what you are trying to do correctly, then you have the
arguments to MapRewriteDomain backwards. From
https://developers.google.com/speed/pagespeed/module/domains#mapping_rewrite
:

pagespeed MapRewriteDomain domain_to_write_into_html
domain_specified_in_html;

If you have:
https://mydomain/foo.html containing
and you specify:
pagespeed MapRewriteDomain https://wordpresscdn.azureedge.net
https://mydomain;
then the HTML will be rewritten as:

This requires that wordpresscdn.azureedge.ne
https://wordpresscdn.azureedge.net/t is set up as a pull CDN with origin
http://mydomain.

Hope this helps,
-Josh

On Sun, May 15, 2016 at 7:21 PM, aelsharawi notifications@github.com
wrote:

Hi

I m using Nginx, and my website is under https

I use these setting but looks like it is not working

######## ADD CDN

pagespeed MapRewriteDomain https://mydomain https://wordpresscdn.azureedge.net;

pagespeed ShardDomain https://mydomain https://wordpresscdn.azureedge.net;
pagespeed MapProxyDomain https://mydomain/wp-content https://wordpresscdn.azureedge.net/wp-content;
pagespeed Domain https://wordpresscdn.azureedge.net;

please help me


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#599 (comment)

@aelsharawi

This comment has been minimized.

Copy link

aelsharawi commented May 16, 2016

Yes, but not working

@jmarantz

This comment has been minimized.

Copy link
Contributor

jmarantz commented May 16, 2016

Ahmad -- can you open up a new issue by clicking this: https://github.com/pagespeed/ngx_pagespeed/issues/new and then describing in more detail exactly what you have in your config and what you are observing? If possible, please provide a URL to your site.

Also, do you have
pagespeed EnableFilters rewrite_domains;
in your config?

@aelsharawi

This comment has been minimized.

Copy link

aelsharawi commented May 16, 2016

I did not enable that
pagespeed EnableFilters rewrite_domains;

--may be it is the whole problem?

I will try and see

@aelsharawi

This comment has been minimized.

Copy link

aelsharawi commented May 16, 2016

still did not work

may be Im writing the setting wrongely

please confirm that Im doing correctly before making a new issue

-I think azure akami cdn support origin pull??

===again my settings are:

######## ADD CDN
pagespeed EnableFilters rewrite_domains;

pagespeed MapRewriteDomain https://zzzz https://zz.azureedge.net;

pagespeed ShardDomain https://zzzz https://zz.azureedge.net;
pagespeed MapProxyDomain https://zzzzz/wp-content https://zzz.azureedge.net/wp-content;
pagespeed Domain https://zzz.azureedge.net;

#####

is there a problem in my settings?

@aelsharawi

This comment has been minimized.

Copy link

aelsharawi commented May 16, 2016

is it related to strict https ??

@jmarantz

This comment has been minimized.

Copy link
Contributor

jmarantz commented May 16, 2016

This is an ancient bug that is already closed. Please send further
discussion & requests for help to
https://groups.google.com/forum/#!forum/mod-pagespeed-discuss , or add a
new bug to discuss this issue.

On Mon, May 16, 2016 at 2:11 PM, aelsharawi notifications@github.com
wrote:

is it related to strict https ??


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#599 (comment)

@aelsharawi

This comment has been minimized.

Copy link

aelsharawi commented May 20, 2016

Im so sorry to post here one more time

I found this error in the nginx log

 [ngx_pagespeed 1.11.33.0-0] No threading detected. Own threads: 1 Rewrite, 1 Expensive Rewrite.
2016/05/20 03:24:57 [info] 10447#10447: pagespeed: rollback gzip, explicit configuration in /etc/nginx/global/gzip.conf:2

and this is the file:
/etc/nginx/global/gzip.conf

# Enable Gzip compression.
gzip on;

# Disable Gzip on IE6.
gzip_disable "msie6";

# Allow proxies to cache both compressed and regular version of file.
# Avoids clients that don't support Gzip outputting gibberish.
gzip_vary on;

# Compress data, even when the client connects through a proxy.
gzip_proxied any;

# The level of compression to apply to files. A higher compression level increases
# CPU usage. Level 5 is a happy medium resulting in roughly 75% compression.
gzip_comp_level 5;

# The minimum HTTP version of a request to perform compression.
gzip_http_version 1.1;

# Don't compress files smaller than 256 bytes, as size reduction will be negligible.
gzip_min_length 256;

# Compress the following MIME types.
gzip_types
        application/atom+xml
        application/javascript
        application/json
        application/ld+json
        application/manifest+json
        application/rss+xml
        application/vnd.geo+json
        application/vnd.ms-fontobject
        application/x-font-ttf
        application/x-web-app-manifest+json
        application/xhtml+xml
        application/xml
        font/opentype
        image/bmp
        image/svg+xml
        image/x-icon
        text/cache-manifest
        text/css
        text/plain
        text/vcard
        text/vnd.rim.location.xloc
        text/vtt
        text/x-component
        text/x-cross-domain-policy;
  # text/html is always compressed when enabled.


@oschaaf

This comment has been minimized.

Copy link
Member

oschaaf commented May 20, 2016

@aelsharawi those are informational messages, you can ignore them.

@aelsharawi

This comment has been minimized.

Copy link

aelsharawi commented May 20, 2016

@oschaaf thanks, can u help me in resolving the CDN issue please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment