crowell / modpagespeed_tmp

Automatically exported from code.google.com/p/modpagespeed
Apache License 2.0
0 stars 0 forks source link

insert_dns_prefetch not including all (sub)domains #717

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the product are you using (please check X-Mod-Pagespeed
header)?
1.3.25.4-2941

On what operating system?
Linux

URL of broken page:
Internal, but will be external next week

---

We use mod_pagespeed very heavily, and I am pushing 1.3.25.4 with 
insert_dns_prefetch forward to our live environment. But I suspect that it 
contains a bug related to domain sharding.

For example, if my page source contains:
<html>
  <head>
    <link rel="stylesheet" href="http://cdn1.domain.com/style-1.css">
    <link rel="stylesheet" href="http://cdn2.domain.com/style-2.css">
    <link rel="stylesheet" href="http://cdn3.domain.com/style-3.css">
    <link rel="stylesheet" href="http://cdn4.domain.com/style-4.css">
    <link rel="stylesheet" href="http://other-domain.com/other-style.css">
  </head>

  ...
</html>

Enabling the filter gives me this:

<html>
  <head>
    <link rel="stylesheet" href="http://cdn1.domain.com/style-1.css">
    <link rel="stylesheet" href="http://cdn2.domain.com/style-2.css">
    <link rel="stylesheet" href="http://cdn3.domain.com/style-3.css">
    <link rel="stylesheet" href="http://cdn4.domain.com/style-4.css">
    <link rel="stylesheet" href="http://other-domain.com/other-style.css">

    <link rel="dns-prefetch" href="//cdn4.domain.com">
    <link rel="dns-prefetch" href="//other-domain.com">
  </head>
  ...
</html>

But I would have expected it to also include cdn[1-3].domain.com. The 
subdomains of domain.com all point to the same IP.

Original issue reported on code.google.com by br...@noerremark.dk on 31 May 2013 at 9:46

GoogleCodeExporter commented 9 years ago
Just to clarify, I assume there are references to cdn[1-3] elsewhere on your 
page?

As another clarification, you're sharding these domains using your 
mod_pagespeed configuration, and they're unsharded on the original page?

There may be a very interesting filter-ordering issue here.

Original comment by jmaes...@google.com on 31 May 2013 at 3:20

GoogleCodeExporter commented 9 years ago
Ohh! Sorry, what I intended to write was the following :-)

My original source has:
<html>
  <head>
    <link rel="stylesheet" href="http://www.domain.com/style-1.css">
    <link rel="stylesheet" href="http://www.domain.com/style-2.css">
    <link rel="stylesheet" href="http://www.domain.com/style-3.css">
    <link rel="stylesheet" href="http://www.domain.com/style-4.css">
    <link rel="stylesheet" href="http://other-domain.com/other-style.css">
  </head>

  ...
</html>

rewrite_domains does my domain sharding correctly:
<html>
  <head>
    <link rel="stylesheet" href="http://cdn1.domain.com/style-1.css">
    <link rel="stylesheet" href="http://cdn2.domain.com/style-2.css">
    <link rel="stylesheet" href="http://cdn3.domain.com/style-3.css">
    <link rel="stylesheet" href="http://cdn4.domain.com/style-4.css">
    <link rel="stylesheet" href="http://other-domain.com/other-style.css">
  </head>

  ...
</html>

But rewrite_domains & insert_dns_prefetch gives me:
<html>
  <head>
    <link rel="stylesheet" href="http://cdn1.domain.com/style-1.css">
    <link rel="stylesheet" href="http://cdn2.domain.com/style-2.css">
    <link rel="stylesheet" href="http://cdn3.domain.com/style-3.css">
    <link rel="stylesheet" href="http://cdn4.domain.com/style-4.css">
    <link rel="stylesheet" href="http://other-domain.com/other-style.css">

    <link rel="dns-prefetch" href="//cdn4.domain.com">
    <link rel="dns-prefetch" href="//other-domain.com">
  </head>
  ...
</html>

Hope that helps :-)

Original comment by br...@noerremark.dk on 31 May 2013 at 5:51

GoogleCodeExporter commented 9 years ago
When I think about it, this may actually be a dublicate of #654. 

Original comment by br...@noerremark.dk on 31 May 2013 at 6:35

GoogleCodeExporter commented 9 years ago
OK, I'll merge it.

Original comment by jmaes...@google.com on 2 Jun 2013 at 10:29