Mod_PageSpeed & CDN Image Canonicals

96 views
Skip to first unread message

ka...@consumermedia.com

unread,
Jul 28, 2016, 1:41:51 AM7/28/16
to mod-pagespeed-discuss
Greetings!

I am looking for a good solution to a problem we are having with image canonicals. For reference, we are on the latest stable version of PageSpeed (1.11.33.2).

Here is the issue:

After PageSpeed optimizes an image it adds a canonical element to the image that references the optimized/rewritten image's original url. (Which is great!)

We then send the optimized/rewritten image to our CDN. Our CDN adds its own canonical reference that points to the PageSpeed url for the image and ignores the canonical supplied by PageSpeed.

Example:



Ideally, the CDN would pick up the canonical reference being sent by PageSpeed and use it as well. Unfortunately, The CDN looks at the image URL which is being pulled and sets that URL as the canonical if the canonical option is enabled.

Does anyone have any suggestions on how to maintain a reference to the original image URL all the way through the CDN?

Thanks!

Karl

Otto van der Schaaf

unread,
Jul 28, 2016, 6:26:47 AM7/28/16
to mod-pagespeed-discuss
When a CDN adds the canonical Link header then it is not present, that is probably going to be helpful. 
But when a CDN overwrites the canonical Link header it receives from your webserver, that sounds like a bug to me. 

Does the admin interface of your CDN have an option somewhere to turn off setting the Link header? I know some do.
If not, I think it makes sense to contact their support.

Otto

ka...@consumermedia.com

unread,
Jul 28, 2016, 12:19:06 PM7/28/16
to mod-pagespeed-discuss
I did contact their support. Unfortunately, the CDN only looks at the image URL which is being pulled and sets that URL as the canonical if the canonical option is enabled. If it is disabled, then no canonical is referenced. I am looking for an alternate solution.

Otto van der Schaaf

unread,
Jul 28, 2016, 6:53:16 PM7/28/16
to mod-pagespeed-discuss
Just to make sure I understand correctly:
- So when you enable the CDN's option to insert canonical Link response-headers it overwrites the Link response headers your server sends it.
- But when you disable it, the CDN strips Link response-headers your server sends it.

If so, the CDN is in full control in all situations, and I don't think there's much we can do to change that.
I do not think there is an alternate way to advertise canonical hrefs at the http level, which is what you would need.

Otto



On Thu, Jul 28, 2016 at 6:19 PM <ka...@consumermedia.com> wrote:
I did contact their support. Unfortunately, the CDN only looks at the image URL which is being pulled and sets that URL as the canonical if the canonical option is enabled. If it is disabled, then no canonical is referenced. I am looking for an alternate solution.

--
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/90582904-c5c8-49f3-b652-a604a36e177c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages