Posted by gibus on November 2, 2009 at 1:12pm
Jump to:
| Project: | Ajax |
| Version: | 6.x-1.14 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
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
#1
I just spotted this too. I've commented out the line and everything's working so far. Does anyone know what it's for?
#2
subscribing
#3
subs
#4
I'm guessing this is to work around some nasty IE caching bugs.
#5
Kiphas is correct. This is a caching workaround. I currently know of no way to remove this without causing other side effects.
#6
@brendoncrawford: Could you give a pointer to the IE bugs that make this workaround necessary?
#7
I 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.
#8
@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?
#9
That'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.
#10
can author answer #8? I think it's appropriate to identify what specific problem this solves.
#11
This 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
#12
The 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,