How to prevent caching of Ajax request using Dojo

The Portlet Specification 2.0 allows you set cache-control header on response of serveResource() call. So what you can do is inside the serveResource() method set max-age for your response like this

Now the question is what if i want to prevent response from being cached if thats the case you can set preventCache flag to true while making dojo request like this

url: "",
preventCache: true,
load: function(data, ioargs){
dojo.byId("resourceResponse").innerHTML = data;
error: function(error,ioargs){

What the preventCache flag would do is that it will append dojo.preventCache query parameter to the url before making request so in my case it will take the <portlet:resourceURL/> and append the dojo.preventCache query parameter and the value of dojo.preventCache parameter will change every time the xhr call is made so server will always return the full response.


Java Tutorials Blog said...

sending ajax request in dojo

srjwebsolutions said...

We are leading responsive website designing and development company in Noida.
We are offering mobile friendly responsive website designing, website development, e-commerce website, seo service and sem services in Noida.

Responsive Website Designing Company in Noida
Website Designing Company in Noida
SEO Services in Noida
SMO Services in Noida

Vikas Chaudhary said...

Battery Mantra is Authorized exide car battery dealer in Noida and Greater Noida. We are providing our service in Indirapuram, Delhi, Ashok Nagar.

Exide Battery Dealer in Noida
Battery Dealer in Noida
Authorized Battery Dealer in Noida
Car Battery Dealer in Noida
Car Battery Dealer
Exide Battery Dealer

EG MEDI said... is online medical store pharmacy in laxmi nagar Delhi. You can Order prescription/OTC medicines online.
Cash on Delivery available. Free Home Delivery

Online Pharmacy in Delhi
Buy Online medicine in Delhi
Online Pharmacy in laxmi nagar
Buy Online medicine in laxmi nagar
Onine Medical Store in Delhi
Online Medical store in laxmi nagar
Online medicine store in delhi
online medicine store in laxmi nagar
Purchase Medicine Online
Online Pharmacy India
Online Medical Store