5.2. Text resource types

Static text resources can be added to a ClientBundle in one of two ways:

  • TextResource—Embedded in the JavaScript payload during compilation and can be used directly in Java code
  • ExternalTextResource—Bundled together into a separate cacheable file, which is loaded asynchronously and stored in memory as soon as the first ExternalTextResource is requested

The difference between the two is therefore which techniques the compiler use to optimize delivery to the application. Let’s start by looking at a simple TextResource.

5.2.1. TextResource

The TextResource optimizes access to text files by embedding them into the JavaScript payload. This reduces the connection count as well as guarantees cacheability.

Much like ...

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.