Active
Project:
Ajax
Version:
6.x-1.14
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2009 at 13:12 UTC
Updated:
17 Nov 2010 at 11:10 UTC
I'm just wondering why ajax_get_redirect function add a random parameter around line 249:
$u['query'][mt_rand()] = 1;
For eg., when using ajax_register module, this leads to some weird url when login form (using ajax) is submitted: my_url?802334268=1.
Is there some good reason to add this random parameter? Or can the above line be safely commented/deleted?
Comments
Comment #1
peacog commentedI just spotted this too. I've commented out the line and everything's working so far. Does anyone know what it's for?
Comment #2
reg commentedsubscribing
Comment #3
chawl commentedsubs
Comment #4
kiphaas7 commentedI'm guessing this is to work around some nasty IE caching bugs.
Comment #5
brendoncrawford commentedKiphas is correct. This is a caching workaround. I currently know of no way to remove this without causing other side effects.
Comment #6
Henrik Opel commented@brendoncrawford: Could you give a pointer to the IE bugs that make this workaround necessary?
Comment #7
reg commentedI wouldn't necessarily call it a bug, it's just the way IE works and we have to work around it so I don't know if there is a place we can point you to the "bug". However, developers have been dealing with IE caching issues forever, just do an Internet search and you will get more search results than you can read through.
Comment #8
Henrik Opel commented@Reg: Thanks for the quick reaction.
[...] just do an Internet search and you will get more search results than you can read through.
That is exactly why I asked here specifically ;)
There is plenty of information on IE caching issues to be found, and there are many different/separate issues to start with (and I have dealt with my fair share of many of those as well).
However I do not know/see the concrete issue that needs to be worked around in the given context, i.e. standard redirection handling in Drupal does not seem to need the random query part, and its sudden usage by the ajax module is surprising.
So my question could be rephrased a bit more precisely: What concrete issues/problems caused the addition of the random query parameter to the ajax modules redirection logic?
Comment #9
reg commentedThat's a good question and having just come across this issue here myself I don't know the answer anymore than you. Hopefully the author can chime on that one.
Comment #10
nibblebot commentedcan author answer #8? I think it's appropriate to identify what specific problem this solves.
Comment #11
kiphaas7 commentedThis was the problem I was talking about:
http://www.codecouch.com/2009/01/how-to-stop-internet-explorer-from-cach...
http://weblogs.asp.net/pleloup/archive/2006/06/08/451583.aspx
Comment #12
igor.ro commentedThe links you provide looks like about IE caching ajax response if ajax send with GET.
Currently we have POST and this url returned is not the one we send ajax too.
So I think we can safely remove rand parameter,