Due to the limited CPU capabilities of mobile devices, the high round-trip times of mobile networks, and the rapid growth of mobile usage, it is even more critical to understand and optimize for mobile performance than for the desktop. Page Speed Insights now allows you to easily analyze and optimize your site for mobile performance. Many of the mobile-targeted best practices below are also relevant when optimizing for desktop, so these suggestions may also be included in Page Speed reports for desktop browsers.
In order to load a page, the browser must parse the contents of all
<script> tags, which adds additional time to the page load. By
executed, you can reduce the initial load time of your page.
When building mobile applications, it can be necessary to load all
application can continue to work when the user is offline. In this
case, some applications, such as mobile Gmail, find it useful to
An alternative to storing code in comments is storing code in
is only parsed when needed, again by calling
the string literal. This technique also allows an application to load
Note that moving your
<script> tags to the end of the page is
sub-optimal, since the browser will continue to show a busy indicator
until the page load indicator shows that the page load is complete
before interacting with the page, so it is important to load
to indicate that the page load is complete.
Make landing page redirects cacheable
Many pages, especially mobile pages, redirect users to a different
URL, for instance from
m.example.com. Making this redirect cacheable by the
user's browser can speed up page load times for repeat visitors to a
While the best practice with redirects is to remove them wherever possible, it can sometimes be difficult to eliminate landing page redirects, especially redirects to mobile-specific sites. For instance, the mobile version of a site may be served from a different web server, which can require redirecting to a different hostname. In these cases, it's important to make the redirect to the mobile-specific site cacheable, to reduce page load times for repeat visitors. If the mobile version of your web site is served from the same web server as the desktop version of your site, you should instead eliminate mobile-specific redirects and serve from the same URL as your desktop page.
Mobile-specific redirects must be privately cacheable, in order to
prevent proxies from serving the mobile redirect to non-mobile
users. We recommend using a 302 redirect with a cache lifetime of one
day. The redirect should include a
header as well as a
Cache-Control: private header. These
headers prevent proxies from serving mobile-specific redirects to
non-mobile users. You may also want to include an
header in the past, to prevent old HTTP/1.0 proxies from caching these
redirects and serving them to non-mobile users.