On Dec 30, 2012, at 7:17 PM, Sherif Ramadan wrote:

> Now for the bad news:
> 
> 1) Prototype actually requires a lot more requests per page view than the 
> existing site. (Upon preliminary testing this about double the number of 
> requests on average). The main reason for this seems to be that the prototype 
> is using one data URI per image in the footer where we display the PHP 
> elephant plushies. This is actually very bad, because data URIs generally 
> gon't get cached by the User Agent. This could mean a lot of extra HTTP 
> requests per page view increasing load with minimal benefit. I highly suggest 
> we refactor this to use a single PNG file as a sprite image that can be 
> cached by the UA and with a little CSS it can work any necessary effect magic 
> needed.


I think you are misunderstanding how data URIs work. We make one JSON request 
to get N elephant images. We then place these into the DOM using data URIs 
specifically to avoid the request overhead you are talking about. If your 
network pane reports ~40 requests, then about half of these are not actually 
http requests.

http://en.wikipedia.org/wiki/Data_URI_scheme#Advantages

Stew
--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to