Forum: Rails Spinoffs (closed, excessive spam) Generic Ajax Problem

292dbc3405a05e3184f5ed17e00cd709?d=identicon&s=25 SImonJ (Guest)
on 2008-07-03 13:36
(Received via mailing list)
I am using Prototype, although I'm not convinced this is really to do
with the Javascript, hopefully someone will have seen this sort of
problem before and can suggest a solution.

Basically I am developing a small app for work which pretty much
entirely relies on Ajax (no page reloads etc). This was working fine
until yesterday when some of the requests just started timing out for
the full 300 seconds, not generating any errors (on either firebug or
the servers php error_log), but just not processing the request.

This problem is exclusive to POST requests where I am trying to update
or create something in the database, however it is not a database
error, as it's not getting that far, it is not even running the first
line of the 'AjaxHandler.php' file that should be called. ( I tested
this by adding a sanity check line of code to write a basic message to
the error_log to say that it was processing that line of code, and
there's no message, despite the fact that there is for all of the GET
requests )

I think it might have something to do with caching, as when I clear
the cache in firefox it works once, however I do have headers that I
thought should be preventing the caching (and had been successfully up
until now) i.e.

header('Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header('Content-Type: text/xml');

I have made changes over the last few days as I am working on this,
but I can't identify any changes that could possibly have caused this
behaviour. I have deliberately left out any specific code so that if
anyone would need to see bits of code for this I can provide it, but
will avoid posting vast quantities of largely irrelevant code.

Thanks,

Simon
4dae3b057d62f103f56d2c5d58007a08?d=identicon&s=25 Ryan Gahl (Guest)
on 2008-07-03 16:40
(Received via mailing list)
To get started, we can test the caching theory pretty easily. When you
are
building your request, append "?###" where ### is a randomly generated
token... therefore making each request to a unique endpoint.



On Thu, Jul 3, 2008 at 6:35 AM, SImonJ <simonjjones@gmail.com> wrote:

>
> the cache in firefox it works once, however I do have headers that I
> but I can't identify any changes that could possibly have caused this
> behaviour. I have deliberately left out any specific code so that if
> anyone would need to see bits of code for this I can provide it, but
> will avoid posting vast quantities of largely irrelevant code.
>
> Thanks,
>
> Simon
> >
>


--
Ryan Gahl
Manager, Senior Software Engineer
Nth Penguin, LLC
http://www.nthpenguin.com
--
WebWidgetry.com / MashupStudio.com
Future Home of the World's First Complete Web Platform
--
Inquire: 1-920-574-2218
Blog: http://www.someElement.com
LinkedIn Profile: http://www.linkedin.com/in/ryangahl
F490e41cd5de1393a9f6958b70dae6ab?d=identicon&s=25 Frederick Polgardy (Guest)
on 2008-07-03 16:56
(Received via mailing list)
Shouldn't matter if these are POST's though, browsers aren't allowed to
cache POST requests.

-Fred

On Thu, Jul 3, 2008 at 9:39 AM, Ryan Gahl <ryan.gahl@gmail.com> wrote:

> To get started, we can test the caching theory pretty easily. When you are
> building your request, append "?###" where ### is a randomly generated
> token... therefore making each request to a unique endpoint.
>

--
Science answers questions; philosophy questions answers.
292dbc3405a05e3184f5ed17e00cd709?d=identicon&s=25 SImonJ (Guest)
on 2008-07-04 10:42
(Received via mailing list)
OK, so I tested the idea of putting a random number on the end of the
url but to no avail.

More weirdness to this issue is that it appears to work as expected
under Firefox 3 on my Ubuntu laptop, but not under firefox 2 on my
Solaris terminal at work... Starts to make me think there is a problem
with the JS, however the request appears just as expected in the
firebug console, but it's just not hitting the PHP file.

Anyone have any ideas at all as I'm starting to lose the will to live
on this one :S

Thanks - Simon

The problem
6e780ee0dc0dd59c93cdcaf45cdef2e4?d=identicon&s=25 Gareth Evans (Guest)
on 2008-07-04 10:48
(Received via mailing list)
Have you got a web debugging proxy? It might be time to dig one out and
see
if you can investigate the request and response and see if it's reaching
the
server at all.
I use Fiddler, but that's windows.

Gareth
292dbc3405a05e3184f5ed17e00cd709?d=identicon&s=25 SImonJ (Guest)
on 2008-07-04 13:43
(Received via mailing list)
OK, quick update, I downloaded a HTTP monitor plugin for firefox and
discovered that although the request was being created, it wasn't
being completely sent - and would get stuck at something 1100/1198 or
something (the numbers changed slightly every time).

Anyway, I saw that this was working when logged on at a different
terminal, so I decided to try running the page with no firebug and no
http monitor plugin and it worked first time (and fortunately every
time after that).

Has anyone seen this sort of thing before? It's a bit of a pain to be
honest as there's every chance that some of the intended users of the
site might be using these sort of plugins...

Simon
0c18b91df2be866982c3c43773071b8c?d=identicon&s=25 ColinFine (Guest)
on 2008-07-07 10:24
(Received via mailing list)
Even before this last mail, my suggestion would have been trying
without firebug. I have hit a different problem (http://
code.google.com/p/fbug/issues/detail?id=650) which I'm sure is firebug
(it is generating an extra HTTP request, rather than failing to submit
one). All I've been able to think of doing is put a note on the page
that it might not work correctly with firefox/firebug: since this is
an internal website, not many users are likely to have fb.
This topic is locked and can not be replied to.