In order to load a page, the browser must parse the contents of all scripts tags, which adds additional time to the page load; it can avoided by:
- Use the
script asyncattribute where appropriate, which prevents parsing from blocking the initial page load by deferring it until the browser’s UI thread is not busy doing something else.
eval()when it is needed.
Landing page redirects cacheable
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, from
m.example.com. 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.