While debugging an ajax problem on IE8 which was not happening on
Firefox, I determined that the different caching policies of browsers
can cause real headaches sometimes.

While things were working consistently great in Firefox, in IE8 ajax
was behaving at times very erratic (while other times it behaved
fine).

Sometimes it would show all the debug info in the ajax request, even
though I had debug turned off at the server.

Sometimes I would get the entire page layout, even though the layout
was ajax (ie. blank) at the server.

Sometimes the  wrong content would appear in the ajax request. It
would say I was logged out, when I wasn't. Or it would show me the
wrong page.

Server side breakpoints didn't help as I could never get one to be
hit.

 I had no firebug to see what was going on, after all this is the
hellhole of MyCrowSoft's Idiotic Emasculation 8.

It sometimes appeared like the app went haywire in Ajax on IE.
Meanwhile on firefox all was bliss, smooth as silk, no problems, nada.

The solution: $this->disableCache; as the first line in appController.

That prevents browser side caching of html pages.

I'm now tempted to keep that in appController always. I still do
client side caching of all other assets, but don't see the point in
cachine html pages.

Can anyone think of any reason why one *wouldn't* want browser side
caching to be turned off for ajax, or any dynamic html pages where the
urls are the same but the content is different?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to