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

  • SEARCH
  • Home
  • 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 9192945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:02:55+00:00 2026-06-17T21:02:55+00:00

I’m able to intercept Dojo 1.6.1 xhr requests using IO Pipeline Topics as described

  • 0

I’m able to intercept Dojo 1.6.1 xhr requests using IO Pipeline Topics as described here:

Dojo – intercepting XHR calls

I would like to add a time parameter to the URL (f.e. &time=12345) to prevent cache in certain (or all) xhr GET requests originating from dojox.data.JsonRestStore (details of what I’m trying to achieve are here). My code looks like this:

dojo.subscribe("/dojo/io/send", function(deferred) {

    if (deferred.ioArgs.url.indexOf("restService1") > -1) {
        deferred.cancel();
        deferred.ioArgs.url += '&time=12345' // test value at this point
        dojo.xhrGet(deferrred.ioArgs);
    }
});

Basically I’m trying to cancel the request, add a string to URL and then make the request with the modified URL.

This does not work at all: the request with modified URL does not end up to the server and I’m getting a lot of these errors to browser console:

Chrome errors

The errors occur in line 14 of dojo.js. The Chrome tab crashes eventually after these errors.

I also tried just modifying deferred.ioArgs.url and doing nothing else but that has no effect.

  • 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-17T21:02:56+00:00Added an answer on June 17, 2026 at 9:02 pm

    The answer comes once again from Sven Hasselbach:

    /**
     * Cache Prevention for Dojo xhr requests
     *
     * Adds no-cache header and enables dojo's preventCache feature
     * for every dojo xhr call. This prevents the caching of partial
     * refreshs.
     *
     * @author Sven Hasselbach
     * @version 0.3
     *
     **/
    dojo.addOnLoad(
        function(){
            if( !dojo._xhr )
            dojo._xhr = dojo.xhr;
    
            dojo.xhr = function(){        
                try{
                    var args = arguments[1];   
                    args["preventCache"] = true;
                    args["headers"] = { "cache-control": "no-cache" };
                    arguments[1] = args;
              }catch(e){}
    
              dojo._xhr( arguments[0], arguments[1], arguments[2] );
            }
        }
    )
    

    http://openntf.org/XSnippets.nsf/snippet.xsp?id=cache-prevention-for-dojo-xhr-requests

    Tried it out and it does exactly what I was looking for by adding &dojo.preventCache=1359366392301 parameter to the xhr URLs. And it seems to add a cache-control header too.

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

Sidebar

Related Questions

I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am using JSon response to parse title,date content and thumbnail images and place
I've got a string that has curly quotes in it. I'd like to replace
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.

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.