Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-10-03 12:07:31

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Downloading in parallel

Is there a recommended way to download in parallel in order to speed up downloads? Searched the web but couldn’t find a clear answer. I think this was discussed here years ago but can’t find the article. It involved using different subdomains and some .htaccess, afaicr.


BB6 Band My band
Gud One My blog

Offline

#2 2020-10-04 04:54:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Downloading in parallel

The question is not clear. Are you talking about files?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2020-10-04 07:01:49

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Downloading in parallel

If you are talking about how browsers download assets when rendering a web page, then parallelisation is less of an issue these days. All modern browsers can simultaneously download at least 6 assets from a domain at the same time (some older browsers around 10 years ago had a limit of 2).

There are still benefits from loading assets from a static domain sometimes though, and you can also lessen http requests using techniques such as image sprites, embedding images in css (data URIs) and even embedded in html on rare occasions.

Offline

#4 2020-10-04 07:09:54

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Downloading in parallel

colak wrote #326212:

The question is not clear. Are you talking about files?

Sorry, I meant the whole website. I’m making an image-heavy site and if the visitor’s browser could download it in parallel, rather than in series as they do by default, then they’d get a better experience. To do this, I think there should be multiple sources for images, files, css so the brower is forced to download in parallel? But I’m not sure about this and can’t find any good info, probably because everyone uses CDNs nowadays, but that is probably unnecessary for this site because the audience is UK only.


BB6 Band My band
Gud One My blog

Offline

#5 2020-10-04 07:19:20

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Downloading in parallel

philwareham wrote #326213:

If you are talking about how browsers download assets when rendering a web page, then parallelisation is less of an issue these days. All modern browsers can simultaneously download at least 6 assets from a domain at the same time (some older browsers around 10 years ago had a limit of 2).

Ah, thanks Phil, I didn’t know that.

There are still benefits from loading assets from a static domain sometimes though, and you can also lessen http requests using techniques such as image sprites, embedding images in css (data URIs) and even embedded in html on rare occasions.

It’s an image heavy site, so I don’t think those techniques would help much in my situation (but I don’t understand them very well). Is there any benefit in loading some images from a sub domain, as well as from the images folder?


BB6 Band My band
Gud One My blog

Offline

#6 2020-10-04 07:43:47

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,194
Website

Re: Downloading in parallel

zero wrote #326215:

It’s an image heavy site, so I don’t think those techniques would help much in my situation (but I don’t understand them very well). Is there any benefit in loading some images from a sub domain, as well as from the images folder?

It might improve the perceived download speed of the images if they are loaded from a sub-domain and the page loads lots of stuff from the main domain (stylesheet, script files…). But I doubt it makes much of a difference, or maybe it still makes a difference if the main domain sets a truckload of cookies.

But have a look at the loading="lazy" attribute for images. Safari release doesn’t seem to support it yet, but Firefox and Chromium/blink do. This would improve perceived page load speed, as the browser would prioritise the “above-the-fold” images.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#7 2020-10-04 07:54:58

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Downloading in parallel

phiw13 wrote #326216:

It might improve the perceived download speed of the images if they are loaded from a sub-domain and the page loads lots of stuff from the main domain (stylesheet, script files…). But I doubt it makes much of a difference, or maybe it still makes a difference if the main domain sets a truckload of cookies.

No cookies, quite simple site, but big high quality images.

But have a look at the loading="lazy" attribute for images. Safari release doesn’t seem to support it yet, but Firefox and Chromium/blink do. This would improve perceived page load speed, as the browser would prioritise the “above-the-fold” images.

Yep, and I see loading="lazy" is now a txp attribute. Nice one, devs!

Last edited by zero (2020-10-04 07:55:15)


BB6 Band My band
Gud One My blog

Offline

#8 2020-10-04 11:41:20

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,260
GitHub

Re: Downloading in parallel

+1 for lazy loading, and I’m a big fan of optimising the living daylights out of your images to reduce bytes sent through the tubes.

Aside: http/2 does multiplexing (formerly known as pipelining) and, if implemented correctly, greatly reduces the TCP handshakes (and a lot of the perceived delays) in http/1. Have a look at www.cloudflare.com/en-gb/learning/performance/http2-vs-http1.1 for some background info that’s not obscenely technical.

Offline

#9 2020-10-04 12:54:33

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Downloading in parallel

gaekwad wrote #326218:

+1 for lazy loading, and I’m a big fan of optimising the living daylights out of your images to reduce bytes sent through the tubes.

Aside: http/2 does multiplexing (formerly known as pipelining) and, if implemented correctly, greatly reduces the TCP handshakes (and a lot of the perceived delays) in http/1. Have a look at www.cloudflare.com/en-gb/learning/performance/http2-vs-http1.1 for some background info that’s not obscenely technical.

Thanks gaekwad, that’s a clear explanation.

<aside> I then wanted to check how to develop for http/2 and searched for http/2 with ecosia search engine. I got a notice saying there was suspicious activity and I should answer the question to prove I was human. But there was no question, so I figured that ecosia was using a gargoyle recaptcha or something linked to gargoyle that my computer would not display because of gargoyle being blocked in my hosts file. So ecosia is another slave to the gargoyle. </aside>

A search for http2 found this guide to http2 and how I can start using it and has useful links to tools and sites. A firefox add-on shows it’s already in use on my sites and servers so I’m already downloading in parallel :-) So, as phiw13 says, using a subdomain would probably only produce minimal benefits if any, so my job just got easier. Still lots of optimisations to do, of course, to try and get close to 100 on the speed tests. All good fun. Thanks guys.


BB6 Band My band
Gud One My blog

Offline

#10 2020-10-04 13:00:18

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,260
GitHub

Re: Downloading in parallel

Can you share your URL so I can have a look at your image settings?

Offline

#11 2020-10-04 14:23:00

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: Downloading in parallel

Thanks for the kind offer, Pete. I will drop you an email when the site’s nearer completion.


BB6 Band My band
Gud One My blog

Offline

Board footer

Powered by FluxBB