Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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.
Offline
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
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
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.
Offline
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?
Offline
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
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)
Offline
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
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.
Offline
Re: Downloading in parallel
Can you share your URL so I can have a look at your image settings?
Offline
Offline