Welcome Guest, Not a member yet? Register   Sign In
Views not getting updated.
#1

[eluser]Reynolds[/eluser]
I have a problem, this could not be CI related. But I'll post it.

I've made a simple script with view that has list of files and a delete button.
listed files are actually stored inside a sub directory. Then I just unlink the file by jquery/ajax call. The problem is that on certain connections, like some within a proxy, is not updating the file list (even though the files are actually deleted). I tried it with a direct internet connection, the view is updated. But with a proxy, its not reflecting it. Result is same using other browsers too.

Had anyone encountered such problem?
#2

[eluser]theprodigy[/eluser]
It's possible the proxy server is serving the response from cache.
#3

[eluser]Reynolds[/eluser]
[quote author="theprodigy" date="1264767299"]It's possible the proxy server is serving the response from cache.[/quote]

yes, that's what I assume too.
Is there a workaround for this? at least within the script? coz I don't have control over the proxy server.
#4

[eluser]theprodigy[/eluser]
Code:
<?
//Set no caching
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); //or some other date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>

might do it.
#5

[eluser]theprodigy[/eluser]
set the above code before echoing ANYTHING or displaying anything to the user.
Even a simple debug output prior to this code running will throw an error since you are altering header information
#6

[eluser]Reynolds[/eluser]
[quote author="theprodigy" date="1264768591"]set the above code before echoing ANYTHING or displaying anything to the user.
Even a simple debug output prior to this code running will throw an error since you are altering header information[/quote]

ok, thanks I will try it now.

perhaps at index.php is better right?
#7

[eluser]Reynolds[/eluser]
I didn't know that code which I had ignored from the past would solve my current problem.

Thanks you so much, now it works! Smile




Theme © iAndrew 2016 - Forum software by © MyBB