Jquery & Codeigniter ajax cache: false |
[eluser]mjsilva[/eluser]
Hi there, TIL that Internet Explorer caches every ajax call, even if you do something like this: Code: $this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); In Jquery you can specify this: Code: $.ajaxSetup({ This is a smart thing, what it do is putting a timestamp in your request, so let's say you have this function: Code: $("#checkout").click(function(){ Your request becomes: http://my_site.com/ajax_fnc/is_logged_in/?_=1274699621534 But codeigniter doesn't appears to like this type of URLs, I've already make this changes in config.php: Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-&='; but I'm still getting 404 errors. Any hint on how to prevent Internet Explorer to cache this type of ajax calls? Or how to make CI to like this URL? tks
[eluser]zoko2902[/eluser]
you can try using the post method, since it's not supposed to be cached.
[eluser]mjsilva[/eluser]
Yes, I ended doing that. But it's one of those things, that I would like to know why it happens, like magnets ![]()
|
Welcome Guest, Not a member yet? Register Sign In |