mod_pagespeed with Google Maps???

423 views
Skip to first unread message

Les Fenison

unread,
May 8, 2015, 7:40:07 PM5/8/15
to mod-pagesp...@googlegroups.com
I have been seeing problems when using the google maps iframe.  modPagespeed helps but very inconsistant.

Issues with browser caching, optimizing images, minify javascript, and worst of all, tap targets violations because links on the google map are too close together.

In an attempt to correct this, I added the following which didn't help at all.

ModPagespeedDomain maps.googleapis.com
ModPagespeedDomain maps.gstatic.com
ModPagespeedDomain ajax.googleapis.com

ModPagespeedDomain https://maps.gstatic.com
ModPagespeedDomain https://maps.googleapis.com
ModPagespeedDomain  https://khms0.google.com


Is there a way to fix this..  Here is the report.  Without the Google Maps this page gets a 100/100, with it is usually 72-78


Consider Fixing:

Reduce server response time

Leverage browser caching

Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
Leverage browser caching for the following cacheable resources:
Hide details

Optimize images

Properly formatting and compressing images can save many bytes of data.
Optimize the following images to reduce their size by 563B (4% reduction).
  • Losslessly compressing https://khms0.google.com/…v=170&hl=en-US&x=40&y=91&z=8&token=73218 could save 563B (4% reduction).
Hide details

Minify JavaScript

Compacting JavaScript code can save many bytes of data and speed up downloading, parsing, and execution time.
Minify JavaScript for the following resources to reduce their size by 817B (2% reduction).
Hide details

6 Passed Rules

Download optimized image, JavaScript, and CSS resources for this page.

99 / 100User Experience

Consider Fixing:

Size tap targets appropriately

Some of the links/buttons on your webpage may be too small for a user to easily tap on a touchscreen. Considermaking these tap targets larger to provide a better user experience.
The following tap targets are close to other nearby tap targets and may need additional spacing around them.
  • The tap target <a href="https://www.go…erms_maps.html">Terms of Use</a> is close to 1 other tap targets.
  • The tap target <a href="//accounts.goo…uccess?pb=!1e2">Sign in</a> is close to 1 other tap targets.
  • The tap target <div></div> and 1 others are close to other tap targets.
Hide details

Joshua Marantz

unread,
May 8, 2015, 9:43:49 PM5/8/15
to mod-pagespeed-discuss
On Fri, May 8, 2015 at 7:40 PM, Les Fenison <lfen...@gmail.com> wrote:
I have been seeing problems when using the google maps iframe.  modPagespeed helps but very inconsistant.

mod_pagespeed will not touch the google maps iframe, unless you are using it as a forward proxy.

Issues with browser caching, optimizing images, minify javascript, and worst of all, tap targets violations because links on the google map are too close together.

In an attempt to correct this, I added the following which didn't help at all.

ModPagespeedDomain maps.googleapis.com
ModPagespeedDomain maps.gstatic.com
ModPagespeedDomain ajax.googleapis.com

ModPagespeedDomain https://maps.gstatic.com
ModPagespeedDomain https://maps.googleapis.com
ModPagespeedDomain  https://khms0.google.com

Don't do that (unless you are running as a forward proxy).  Those domains don't run mod_pagespeed.  The only thing that can happen by enabling your server to rewrite resources on those domains is that you will generate 404s.  Usually Google assets are already optimized, but there is a nonzero chance that mod_pagespeed's minifier will make JS served from gstatic.com slightly smaller.  And when it does that it will rename the file, hypothetically:


maps.gstatic.com will not know how to decode that, and will return a 404.


Is there a way to fix this..  Here is the report.  Without the Google Maps this page gets a 100/100, with it is usually 72-78

Don't consider PageSpeed Insights to be a laundry list of things you absolutely have to fix.  mod_pagespeed tries to help you get as high a score as is feasible automatically.  However pages that don't run mod_pagespeed or something similar will have a hard time getting perfect scores because they won't be able to set long cache TTLs without compromising their ability to push out changes to their site.

And note that you cannot fix iframed pages (including google maps) using MPS.  You must rely on the google maps team to improve those pages.

-Josh

Reply all
Reply to author
Forward
0 new messages