PageSpeed: Serve resources from a consistent URL


It's important to serve a resource from a unique URL, to eliminate duplicate download bytes and additional RTTs.

How does your site score on this recommendation?

Details from Google

Sometimes it's necessary to reference the same resource from multiple places in a page - images are a typical example. Even more likely is that you share the same resources across multiple pages in a site such as .css and .js files. If your pages do need to include the same resource, the resource should always be served from a consistent URL. Ensuring that one resource is always assigned a single URL has a number of benefits. It reduces the overall payload size, as the browser does not need to download additional copies of the same bytes. Also, most browsers will not issue more than one HTTP request for a single URL in one session, whether or not the resource is cacheable, so you also save additional round-trip times. It's especially important to ensure that the same resource is not served from a different hostname, to avoid the performance penalty of additional DNS lookups.

Note that a relative URL and an absolute URL are consistent if the hostname of the absolute URL matches that of the containing document. For example, if the main page at references resource /images/example.gif and, the URLs are consistent. However, if that page references /images/example.gif and, these URLs are not consistent.



PageSpeed recommends:

Serve shared resources from a consistent URL across all pages in a site

For resources that are shared across multiple pages, make sure that each reference to the same resource uses an identical URL. If a resource is shared by multiple pages/sites that link to each other, but are hosted on different domains or hostnames, it's better to serve the file from a single hostname than to re-serve it from the hostname of each parent document. In this case, the caching benefits may outweigh the DNS lookup overhead. For example, if both and use the same JS file, and links to (which will require a DNS lookup anyway), it makes sense to just serve the JS file from In this way, the file is likely to already be in the browser cache when the user goes to

Read More