![]() |
Inline JavaScript Experiment - Printable Version +- WebPagetest Forums (https://www.webpagetest.org/forums) +-- Forum: Web Performance (/forumdisplay.php?fid=3) +--- Forum: Optimization Discussions (/forumdisplay.php?fid=5) +--- Thread: Inline JavaScript Experiment (/showthread.php?tid=300) |
RE: Inline JavaScript Experiment - green-watch.org - 07-11-2010 12:53 AM Hey Patrick, Can you tell me if I did this correctly? I have CNAMEs setup using this format: ALIAS NAME -> FULLY QUALIFIED DOMAIN NAME (FQDN) FOR TARGET HOST images1 -> images2.green-watch.org. images2 -> images3.green-watch.org. images3 -> images4.green-watch.org. images4 -> images5.green-watch.org. images5 -> images6.green-watch.org. images6 -> images7.green-watch.org. images7 -> images8.green-watch.org. images8 -> images9.green-watch.org. images9 -> images10.green-watch.org. images10 -> cdn.green-watch.org cdn -> MYSUBDOMAIN.netdna-cdn.com. The MYSUBDOMAIN stands for the subdomain maxcdn gave me. I just did this last night so perhaps it has not propagated yet because I have not seen a difference in results. Thanks again for any information. ![]() Sincerely, Travis Walters RE: Inline JavaScript Experiment - pmeenan - 07-11-2010 01:42 AM Short version: I think it's a testing problem and you have it set up correctly. Long version: Looks like you have it configured correctly: Non-authoritative answer: Name: cdn.greenwatchllc.netdna-cdn.com Address: 69.174.57.105 Aliases: images1.green-watch.org images2.green-watch.org images3.green-watch.org images4.green-watch.org images5.green-watch.org images6.green-watch.org images7.green-watch.org images8.green-watch.org images9.green-watch.org images10.green-watch.org cdn.green-watch.org There's a really good chance that I need to tweak the testers a bit for the benefit to show. Right now I have the windows DNS caching service disabled so that DNS lookups will not get cached across multiple browsers and from run to run. I'll take a look and see what it would take to flush the DNS cache between runs instead (this wouldn't have worked with multiple browsers running at the same time but now that I'm down to a single browser per machine it may be feasible). Thanks, -Pat RE: Inline JavaScript Experiment - calumfodder - 07-11-2010 05:18 AM I see that Pat got there before me :-) The only suggestion I would add would be to have the entry point to the alias stack be the first DNS request that will be called from your page. So it is worth having your CSS/JS files served from the same subdomain. So in this instance you serve your CSS/JS files from cdn.green-watch.org, so I would configure the stack like so: cdn -> images1.green-watch.org. images1 -> images2.green-watch.org. images2 -> images3.green-watch.org. images3 -> images4.green-watch.org. images4 -> images5.green-watch.org. images5 -> images6.green-watch.org. images6 -> images7.green-watch.org. images7 -> images8.green-watch.org. images8 -> images9.green-watch.org. images9 -> images10.green-watch.org. images10 ->MYSUBDOMAIN.netdna-cdn.com. This way the first DNS request to cdn should logically force the recovery of all the aliases. I'm going to have to do some digging to confirm thats actually how the CNAME lookup will work. With browsers that have more that 2 parallel connections and no blocking JS then any images in the main page might end up causing further DNS requests if served from different subdomains. But through some planning it should be possible to migitate this. On the subject of reducing your document Complete time, I had a brief look at your test site http://www.green-watch.org/test4.cfm. It appears that you are resizing a number of your images in html/css. The elements that look to be pushing out your document complete time are images. These seem to be limited by transfer speeds, 900ms to transfer 30KB of image (the sears coupon). So making sure you serve up images that are the same size as required by your page will improve matters in this regard. Having said that the page is much faster on my home DSL connection only 169ms for the 30KB image which is more in line with a 2Mb/s DSL link (if my calculations aren't skewed). If these images are being served from a CDN, this download time seems a little slow. Also are these coupons integral to the initial content of the page? Might it be worth asynchronously loading them and progressively enhancing your page with the graphics. This way you can kinda cheat on your document complete time, howver you will need to make sure that the site looks good in a "bare" state which then gets enhanced with the extra widgets and goodies. Cheers Cal RE: Inline JavaScript Experiment - green-watch.org - 07-11-2010 10:16 AM Thanks for all the great advice. I just changed the cdn alias so it is first in the list and the images10 alias so it is last on the list. I guess I just have to wait until they propagate. In regards to images, I have to import about 45 million more products, download images, resize them, etc. Now would be a great time to look back into those scripts since the layout is messed up until it propagates. The coupons on the home page (and load sequence) are temporary right now. Green coupons is something I am going to be implementing on my website eventually. So much to do ![]() RE: Inline JavaScript Experiment - green-watch.org - 07-11-2010 11:25 PM Hey Guys, Do either of these links work for you: #1 - http://cdn.green-watch.org/inc/style.cfm #2 - http://images1.green-watch.org/img/jpg/myLogo2.jpg These are towards the end of my CNAME chain and do not work for me at this time. I was looking at the following post: http://fixunix.com/dns/51757-chaining-cnames.html "To prevent loops, servers usually have a limit on the number of times they'll restart a query. And since it's not common to have long chains of CNAMEs, the limit is typically pretty low, like 5-10, and most of this can be taken up by having to resolve NS records in delegations." Does anybody know if there is such a limit to the number of CNAMEs that can be chained together? Also Patrick, I seen the following article: http://www.tech-faq.com/how-to-flush-dns.html Perhaps you could use the "ipconfig /flushdns" run command to flush the DNS settings some how? On browser close, run a batch file with that command in it? Sincerely, Travis Walters RE: Inline JavaScript Experiment - pmeenan - 07-12-2010 02:19 AM #1 works for me but #2 returns a 502 error (not a DNS problem). If there is ANY risk I'd err on the side of much shorter chains. in the DNS flush front, I'm checking quickly to see if I can find an API first. If not then I'll launch a shell with ipconfig /flushdns. I need to make a few other tweaks to the code to not disable the caching service as well. Probably be out at the pool with the kids today so I'll try to wedge it in tonight or tomorrow. RE: Inline JavaScript Experiment - green-watch.org - 07-12-2010 03:32 AM I just noticed that under maxcdn the original IP address is set to 69.174.57.105 for images1.green-watch.org and 69.43.203.167 for the other subdomains. When I click the test IP button I get a bad gateway error which is a 502 error like you stated. I made a Host (A) record for images1 just now that points to 69.43.203.167. I think once it resolves I can update it through maxcdn and then try to create the chain again. I am about to watch the soccer game finals and call it a night or day rather ![]() RE: Inline JavaScript Experiment - sajal - 07-12-2010 08:04 AM (07-11-2010 11:25 PM)green-watch.org Wrote: Do either of these links work for you: From my ISP this wont work, but if I were set to using Google's DNS or OpenDNS (i assume both to follow the RFCs to the book) it would have worked Both give me server not found err on firefox... My ISP probably has limits on the size of the chain. (note the missing A record when querying my default nameserver) Using my ISP Code: sajal@sajal-laptop:~$ dig cdn.green-watch.org Using Google's DNS Code: sajal@sajal-laptop:~$ dig cdn.green-watch.org @8.8.8.8 Using OpenDNS Code: sajal@sajal-laptop:~$ dig cdn.green-watch.org @208.67.222.222 RE: Inline JavaScript Experiment - green-watch.org - 07-12-2010 03:36 PM Hey Guys, Thanks for the responses. From what I have gathered, it looks like there is a maximum chain length. From Sajal's results, it looks like it may vary by ISP or DNS server. Before I give up on chaining CNAMEs together, I am going to try to create three smaller chains like so: images1 -> images2.green-watch.org. images2 -> images3.green-watch.org. images3 -> images3.greenwatchllc.netdna-cdn.com. -> 69.174.57.105 images4 -> images5.green-watch.org. images5 -> images6.green-watch.org. images6 -> images7.green-watch.org. images7 -> images7.greenwatchllc.netdna-cdn.com. -> 69.174.57.105 cdn -> images8.green-watch.org. images8 -> images9.green-watch.org. images9 -> images10.green-watch.org. images10 ->images10.greenwatchllc.netdna-cdn.com -> 69.174.57.105 Sincerely, Travis Walters RE: Inline JavaScript Experiment - jklein - 07-13-2010 12:19 AM Couple of things: 1. Another downside of in-lining JS is that most bots will only crawl a certain distance into the page, and they weight the content at the top more heavily than the content at the bottom. By putting inline JS in your document head you may make the bot bail before it finishes crawling the whole page, and you may reduce the weight of any real content you have in the body of your document. 2. Sharding static content across 10 sub-domains is probably overkill. Depending on what browsers people are typically using on your site this could cause way too much thrashing. A browser like Firefox that makes 8 connections per domain doesn't need that level of sharding (in fact it will likely make your site load SLOWER). The recommendation from Yahoo is to shard across two domains and no more. That post is also old, written when many more people were using IE 6 and 7 and we needed to be sharding more aggressively. |