coderifous / jquery-localize

a jQuery plugin that makes it easy to internationalize your web site.
465 stars 142 forks source link

Load files asynchronously and cache them #49

Closed zoulou2356 closed 9 years ago

zoulou2356 commented 9 years ago

Synchronous request are now deprecated. Would it be possible to change the ajax request loading the translation files and do it asynchronously?

Then it would be nice to have a cache mechanism to store the translations in memory and thus avoid the asynchronous call if the data was already loaded once.

See warning from Google Chrome: "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/."

coderifous commented 9 years ago

Thanks. I'll look into this. I think removing the async:true will not cause a problem in real usage, but I basically have to refactor the tests heavily, which may as well involve an upgrade of QUnit. I will look for time to do this.

coderifous commented 9 years ago

RE caching: Vanilla HTTP Browser cache should be sufficient, and it's "free" given correct web server setup. I'm not convinced it would be worth the cost of complexity to implement a customer cache level using something like HTML5 Storage or whatever.

DioNNiS commented 9 years ago

Become an issue for me as well.

mebobby2 commented 9 years ago

Any update on this? This is currently a major obstacle in me using the library.

coderifous commented 9 years ago

There is another ticket covering async. I think the caching point is separate and a misunderstanding.