5.3. ImageResource

Rather than using images directly in your GWT applications, you can add the images to a ClientBundle as ImageResources. You can use these ImageResources anywhere in an application that the source image would be used; but when they’re added to the ClientBundle as ImageResources, the GWT compiler is given a chance to optimize their delivery to the application.

ClientBundle uses all of the tricks you’ve seen previously to optimize the delivery of ImageResource, plus more. Small images may be embedded in the JavaScript pay-load; multiple images may be combined into a single, more efficient, image strip file; and animated images may be given cacheable filenames. ClientBundle will decide the best technique to use at compile time ...

Get GWT in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.