News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

JSLabs Blog:
How to stop IE from caching AJAX requests
February 05, 2007 @ 08:05:00

If you've ever had the frustration of working with Ajax in Internet Explorer and have noticed it caching the requests/results, you might want to check out this new post on the JSLabs blog for a helpful hint.

While working on an AJAX project over the weekend, I ran into the following issue: (through a GET request), every time I tried to call a certain function, It was returning the same data (which was supposed to be different each time)

First, he tried just changing the headers (via PHP's header function) to see if IE would understand the new message, but to no avail. He finally figured out that, despite whatever headers were sent or how much the content changed, what he really needed to do was to provide the script some kind of unique identifier with each request (just appended to the url) so that IE knew the request was different. His weapon of choice was a date/time value.

1 comment voice your opinion now!
ajax internetexplorer cache request timestamp unique header ajax internetexplorer cache request timestamp unique header


blog comments powered by Disqus

Similar Posts

ProDevTips.com: Multiple File Uploads with XHR and PHP

Jim Plush's Blog: MYBIC GOES 1.0! (yes, yes with firebug debugger!)

PHPro.org: PHP Security

Ian Selby's Blog: Making RESTful Requests in PHP

DevShed: Finding Paths, Timestamps and More with the DirectoryIterator Class in PHP


Community Events

Don't see your event here?
Let us know!


install framework extension php7 xdebug introduction interview laravel5 series laravel example library api podcast opinion language voicesoftheelephpant community release unittest

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework