Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8672583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:14:29+00:00 2026-06-12T19:14:29+00:00

I am trying to better understand the use of GWT ClientBundle and caching. If

  • 0

I am trying to better understand the use of GWT ClientBundle and caching.

If I have a large text file, for example, that I’d like to make available to my client, I can use

public interface MyResources extends ClientBundle {
    public static final MyResources INSTANCE =  GWT.create(MyResources.class);    
      @Source("myText.txt")
      public TextResource myText();
}
//-- then later to use the text
String text = MyResources.INSTANCE.myText().getText(); 

Does this mean that the file “myText.txt” would be downloaded from the server the first time the client runs the app, and then the file would be stored in the browser’s cache so that in future uses of the app, the file does not need to be downloaded?

If so, what happens if I change “myText.txt”, does the app know to get the new version?

Finally, if the file is indeed stored in the cache, how then is this different from local storage in HTML5?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:14:30+00:00Added an answer on June 12, 2026 at 7:14 pm
    • As Daniel Kurka already mentioned, the resources can be inlined in the js file (a *.cache.* file) where the rest of the compiled GWT code lives.
    • Inlining does not occur for all resources in a client bundle. E.g. large images are never inlined, it can also be prevented with @ImageOptions.preventInlining(), and it doesn’t occur for ExternalTextResources.

    What’s common for both cases is, that the results will be in *.cache.* files, with unique names that change automatically whenever the contents of a source file change (you’ll have to recompile the GWT app though!)

    This allows the server to deliver these files with appropriate caching HTTP headers (you’ll have to set this up yourself!) For the client this means, that it will not only be able to cache the contents (which it does anyway, even if those headers aren’t set), but it can even skip asking the server, if a newer version exists.

    The big advantage of ClientBundles is, that the file names will change automatically. The biggest disadvantage is, that you must recompile your GWT app, when a resource changes. If you don’t want that, then it’s better to use some other approach to load the files: You can still make the browser cache any file you like (by setting the HTTP headers), but then you’ll have to be careful to manually give them a new name, when the content changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to better understand when I should and should not use Iterators.
I'm trying to better understand what the stack trace means. I have a two
I'm trying to understand recursions and caching much better and still I'm making interesting
I'm trying to understand better how Windows sessions work, so if I have some
I'm trying to better understand Cross Site Scripting and lets use: http://api.beatport.com/crossdomain.xml as the
I'm trying to understand mod_rewrite better and have one particular problem I think I
I have a simple jsfiddle where I'm trying to better understand value binding. I
I am trying to understand how to use Fragments to create apps that adapt
I've been trying to use Firebug's profiler to better understand the source of some
I am trying to better understand basic concepts in OOP. What are static and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.