http-equiv=refresh issue with AMP pages

481 views
Skip to first unread message

Saumya Majumder

unread,
Mar 15, 2016, 5:07:05 AM3/15/16
to ngx-pagespeed-discuss
Hey guys I'm using pagespeed on my wordpress site. Now I'm also using the AMP plugin by Automatic to create AMP pages for my article. but when I check my websiters there are lots of error in my emp pages for the http-equiv=refresh tag as it is not supported within amp pages.

Now when I looked into it I saw that it was getting added by Pagespeed. Does anyone has any idea about any way to fixing this?


any help?

Otto van der Schaaf

unread,
Mar 15, 2016, 6:00:26 AM3/15/16
to ngx-pagespeed-discuss
The http-equiv=refresh tag is injected by the "resize mobile images" filter in your case.

You could consider disabling this filter for AMP pages only by letting the backend respond with a response header like this for AMP html to fix this specific issue:

PageSpeedFilters: -resize_mobile_images

AMP compatibility is tracked here: https://github.com/pagespeed/mod_pagespeed/issues/1263, I cross linked this post over there.

Saumya Majumder

unread,
Mar 15, 2016, 6:06:34 AM3/15/16
to ngx-pagespeed-discuss
Thanks for the reply. Is there any way to disable mobile resize only for AMP pages while keeping it active on other pages (non AMP)?

Also I don't have that resize_mobile_image turned on explicitely. I hope it is getting called from one of the top filters that I use, i.e.

  pagespeed EnableFilters rewrite_images;
  pagespeed
EnableFilters inline_images;
  pagespeed
EnableFilters recompress_images;
  pagespeed
EnableFilters jpeg_subsampling;
  pagespeed
EnableFilters convert_png_to_jpeg;
  pagespeed
EnableFilters resize_images;
  pagespeed
EnableFilters convert_jpeg_to_webp;
  pagespeed
EnableFilters convert_to_webp_lossless;



Anyways, is there a way to disable resize_mobile_images only for AMP pages?

Joshua Marantz

unread,
Mar 15, 2016, 9:38:51 AM3/15/16
to ngx-pagesp...@googlegroups.com
I am working on this even as we speak :)

Please subscribe to the bug Otto mentioned  (https://github.com/pagespeed/mod_pagespeed/issues/1263) to track progress.

Until that lands, you might be able to use a location-block in your nginx configuration if you structure your URLs so amp gets served out of its own directory or something.  Then you can turn off a few filters in that location block.  Based on my initial work, that set includes:

add_instrumentation
prioritize_critical_css
dedup_inlined_images
defer_iframe
delay_images
insert_ga
javascript_filter
combine_javascript
defer_javascript
inline_javascript
outline_javascript
lazyload_images
local_storage_cache
make_show_ads_async

As well as:
  pagespeed CriticalImagesBeaconEnabled off;


Also -- can you send a pointer to the automatic AMP converter by'automatic'?  Searching for 'amp automatic converter' gives all kinds of totally unrelated hits :)

-Josh

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

Jeff Kaufman

unread,
Mar 15, 2016, 9:56:23 AM3/15/16
to ngx-pagesp...@googlegroups.com
On Tue, Mar 15, 2016 at 9:38 AM, 'Joshua Marantz' via
ngx-pagespeed-discuss <ngx-pagesp...@googlegroups.com> wrote:
>
> can you send a pointer to the automatic AMP converter by'automatic'?

https://github.com/Automattic/amp-wp

> Searching for 'amp automatic converter' gives all kinds of totally unrelated
> hits

The extra "t" in "Automattic" is helpful in this case, though annoying
in general.

Jeff

Saumya Majumder

unread,
Mar 15, 2016, 10:35:16 AM3/15/16
to ngx-pagespeed-discuss
Thanks Jeff, for the reply.

I think it would be great to add pagespeed Disallow */amp/*; in my pagespeed config rather than tweaking the nginx config. After you guys push a fix then I can delete it to make things work in full pace. 
I've also subscribed to the github issue. 

Thanks again for the reply.
Reply all
Reply to author
Forward
0 new messages