http - Requests done in the onModuleLoad are not cached at all. Mainly in FireFox -



http - Requests done in the onModuleLoad are not cached at all. Mainly in FireFox -

i faced issue in requests done in onmoduleload event not beingness cached in cases (mainly firefox). checked network console on firebug , shows kinds of requests beingness fetched server , not cache.

i prepared test case, can check @ http://tradeosam.appspot.com/

and here onmoduleload implementation:

public void onmoduleload() { requestbuilder request = new requestbuilder(requestbuilder.get, "query/test?v=1-8951245"); seek { request.sendrequest(null, new requestcallback() { @override public void onresponsereceived(request request, response response) { } @override public void onerror(request request, throwable exception) { } }); } grab (requestexception e) { } new timer() { @override public void run() { requestbuilder request = new requestbuilder(requestbuilder.get, "query/test?v=1-23478.34"); seek { request.sendrequest(null, new requestcallback() { @override public void onresponsereceived(request request, response response) { } @override public void onerror(request request, throwable exception) { } }); } grab (requestexception e) { } } }.schedule(1000); }

as can see code, 2 requests onmoduleload, first 1 straight done , never beingness cached browser. sec 1 done timer after 1 second, , cached no problems. both these requests have same headers, , go same servlet, difference "v" parameter used differentiate between two.

now don't see "query/test" requests in showcase, xhr requests see there don't have caching instructions browser. default browsers not cache xhr requests, b/c rule such requests must bring fresh data. if want forcefulness browser caching them, add together cache-control request header on client side. cannot specify concrete rules, because don't know requirements - @ to the lowest degree how long should maintain data.

please refer rfc: "caching in http" , fine article http caching: "caching tutorial".

hope helps.

http firefox gwt firebug

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

Hibernate criteria by a list of natural ids -

ios - Lagging ScrollView with UIWebview inside -