EllisLab text mark
Advanced Search
     
Views not getting updated.
Posted: 29 January 2010 01:39 AM
Avatar
Joined: 2007-05-17
39 posts

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?

 Signature 

||Web: http://www.eoanlabs.com , http://www.phpugph.com ||
—————————————————-
“‘its better to know a bit of everything, than everything of a bit.”

 
Posted: 29 January 2010 02:14 AM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2008-11-18
678 posts

It’s possible the proxy server is serving the response from cache.

 Signature 

Quality Coder | Looking for work? | Logo by InsiteFX

 
Posted: 29 January 2010 02:31 AM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-05-17
39 posts
theprodigy - 29 January 2010 07:14 AM

It’s possible the proxy server is serving the response from cache.

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.

 Signature 

||Web: http://www.eoanlabs.com , http://www.phpugph.com ||
—————————————————-
“‘its better to know a bit of everything, than everything of a bit.”

 
Posted: 29 January 2010 02:34 AM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-11-18
678 posts
<?
//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.

 Signature 

Quality Coder | Looking for work? | Logo by InsiteFX

 
Posted: 29 January 2010 02:36 AM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2008-11-18
678 posts

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

 Signature 

Quality Coder | Looking for work? | Logo by InsiteFX

 
Posted: 29 January 2010 02:51 AM   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2007-05-17
39 posts
theprodigy - 29 January 2010 07:36 AM

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

ok, thanks I will try it now.

perhaps at index.php is better right?

 Signature 

||Web: http://www.eoanlabs.com , http://www.phpugph.com ||
—————————————————-
“‘its better to know a bit of everything, than everything of a bit.”

 
Posted: 29 January 2010 03:05 AM   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2007-05-17
39 posts

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

 Signature 

||Web: http://www.eoanlabs.com , http://www.phpugph.com ||
—————————————————-
“‘its better to know a bit of everything, than everything of a bit.”