Welcome Guest, Not a member yet? Register   Sign In
Preloading images in CodeIgniter 2.0.1
#1

[eluser]Unknown[/eluser]
With Codeigniter, when I load a page with a list of images (nearly 20-30 for a webtv),
these images load slowly (one per one).

I'd like to know if there is a solution to load these images (pre-cache) before the load page.

Thanks for your help !
#2

[eluser]osci[/eluser]
You can precache images with javascript. search in google for that.

The problem is not with php or ci, it has to do with http rfc.
Browsers limit connections to a single HTTP 1.0 server to four simultaneous connections. Connections to a single HTTP 1.1 server are limited to two simultaneous connections. The HTTP 1.1 specification (RFC2616) mandates the two-connection limit. The four-connection limit for HTTP 1.0 is a self-imposed restriction that coincides with the standard that is used by a number of popular Web browsers.

Brief to say the best solution is to use cdn, as it increases the different servers to get connections and results to bypassing the 4 or 2 connections limit. But cdn costs.

What iI want to check (or if anyone else has some info on that) is if you have at the same server (and ip) stat1.domain.com and stat2.domain.com will they be considered different server names and be used as an alternative pseudo cdn?
#3

[eluser]wh1tel1te[/eluser]
[quote author="osci" date="1302226762"]What iI want to check (or if anyone else has some info on that) is if you have at the same server (and ip) stat1.domain.com and stat2.domain.com will they be considered different server names and be used as an alternative pseudo cdn?[/quote]

That is correct, subdomains are treated as different domains, so it bypasses the asset load limit. i.e. you can load two images/assets per subdomain at the same time.
#4

[eluser]osci[/eluser]
@wh1tel1te thanks a lot for the info. You saved my day researching Smile
Of course this is not cdn, as you reach the same server in the end, but you can have more connections meaning you have a slight increase in speed.

Got it in my main todo list for my sites.
#5

[eluser]Unknown[/eluser]
Thanks a lot !
I will test :
- with subdomains
- precache images with javascript
- convert my images JPG in progressive mode

See you soon.




Theme © iAndrew 2016 - Forum software by © MyBB