browser caching

Discussion in 'Game Development (Technical)' started by lennard, Feb 18, 2013.

  1. lennard

    Expand Collapse
    Moderator Original Member Indie Author

    Jan 12, 2006
    Likes Received:
    So, after some reading I decided to take a pass on Starling and do the next game in HTML. It's (surprise) another financial strategy game so I don't need to have a gazillion sprites moving on the screen but hitting a lot of devices at once has high value to me.

    This AM I have a caching question:

    I have 32 property cards that are 300x300 pixels - would you store these in a single large sheet or as indvidual images? I'm leaning towards the latter for faster start up as I expect to eventually have an asynchronous loading scheme so that the game starts faster (with the expectation that all of these large jpg files will sit in cache).
  2. Stropp

    Expand Collapse
    New Member

    Jun 25, 2008
    Likes Received:
    I think, I read it somewhere but I haven't tried it, the latest CSS allows you to have a single image with multiple embedded images and specify each as individual graphics objects.

    I was reading an article on optimising web pages and this was one of the points to help the page load faster. I'm not sure what happens if the image sheet is huge though, if the savings outweigh the extra loading time for a sizable file. You might want to do some testing on this.

    But if you use a lossy format like JPEG you might be able to make the file small enough, and if you set it to cache and use a CDN it would probably be worthwhile.

Share This Page