Results 1 to 7 of 7

Thread: reduce no of http requests for images

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    88

    Default reduce no of http requests for images

    Hi,
    I am using Ext 2.2.1 ,I am using sprites images to help make fewer http connections.But inspite of that our app makes 31 fetches for images .In FF I noticed that most of them are ext images (some of them single images and not sprites surprisingly !!).I have attached a screenshot of the GET requests.My question is ,why is Ext fetching those images seperately and not combining them into sprites? is there a production version of Ext that I need to use which uses sprite images ?
    My problem is even if my app uses css sprites , Ext is making the loading worse.
    YSlow gives 'F' score because of this.

    Any help is appreciated.
    Attached Images Attached Images

  2. #2
    Ext JS Premium Member Lloyd K's Avatar
    Join Date
    Oct 2007
    Location
    Brighton, United Kingdom
    Posts
    655

    Default

    don't sprites only work with images of similar size, like toolbar images?
    - Lloyd K

    I blog about code from time to time: http://codeology.lloydkinsella.net/

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    To be more precise: Sprites are only useful for fixed-size images (and sometimes images with a predefined maximum size).

    Ext already uses sprites as often as possible within a single component, but it doesn't combine sprites from different components.

    If you want to reduce the number of requests you should configure your caching better on your HTTP server (images should have a very long expiry time).

  4. #4
    Sencha User
    Join Date
    Jul 2009
    Posts
    88

    Default

    Where do i set the expiry time for images in the server ? our server is from SalesForce.com , there is not much control in the server for me.
    Shouldnt Ext take care of his own images/files in terms of setting the expiry?

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    What kind of HTTP server does SalesForce.com use? Apache? In that case you should specify it in you .htaccess file.

  6. #6
    Sencha User
    Join Date
    Jul 2009
    Posts
    88

    Default

    they use app server 'Resin'

  7. #7
    Sencha User mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061

    Default

    I've posted about this before. I haven't checked FF 3.5, but it was true of all the browsers at the time.

    When you reference an image in css:
    Code:
    .my-selector {
       background: transparent url(path/to/image.gif);
    }
    The browser does not obey caching headers for path/to/image.gif sent by the server. Because Ext makes heavy use of images in CSS, you will see requests for lots of images and 302 not modified responses to those.

    It doesn't matter what type of image (gif, jpg, whatever).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •