• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cache problem for safari browser

#1
[eluser]crimsun[/eluser]
Hello Team,

I am working with CI 1.7.3 version i face one problem when i logout from my site and use the browser back button so its show me the previous page from where i logout from site....

I resolved this problem using cache clear as

eg:-

Code:
$this->no_cache();

Code:
protected function no_cache(){
                header('Cache-Control: no-store, no-cache, must-revalidate');
                header('Cache-Control: post-check=0, pre-check=0',false);
                header('Pragma: no-cache');
        }

And its work fine for the some of broswer as Firefox chrome etc....but i still face the problem for safari browser its still show me the previous page rather that redirect to login page.

So please suggest me any solution for this if any ....Thanks in Advance...

#2
[eluser]InsiteFX[/eluser]
From what I have found is that there seems to be a bug in the way that safari caches pages!

You can try this but it may not work!
Code:
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");

InsiteFX

#3
[eluser]crimsun[/eluser]
Yes i tried this but still i face the same problem..........

Which code i used that's work for only firefox and chrome browser but its not work for safari broswer...

so please suggest any other way or is safari not support to this..

Thanks

#4
[eluser]InsiteFX[/eluser]
You search using google, but like I said safari has problem clearing it's cache!

InsiteFX

#5
[eluser]crimsun[/eluser]
hi InsiteFX

So you mean to say there is no any way clear the cache for safari browser.....its browser issue...

#6
[eluser]InsiteFX[/eluser]
No that I could find searching for it, but I did read that the next update was to fix the problem. Yet to be seen!

I think wordpress has away of doing it but you would need to dig through the wordpress code. I have wordpress installed on my localhost give me a little time and I' ll search through the code and see if I can find how they are handling it.

InsiteFX

#7
[eluser]InsiteFX[/eluser]
Ok I have done some more research on this so give these a try!
Code:
// .htaccess
<IfModule mod_headers.c>
  Header set Cache-Control "public"
  <FilesMatch "\.php$">
      Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0"
  </FilesMatch>
</IfModule>

// PHP Version.
&lt;?php
header('Expires: Wed 11 Jan 1984 05:00:00 GMT');
header('Last-Modified: 'gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-stor, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0');
header('Pragma: no-cache');
?&gt;

// Header test function. Run right after setting headers!
&lt;?php
if (headers_sent())
{
    echo '<h1>Headers sent</h1>';
}
else
{
    echo '<h1>Headers not sent</h1>';
}

echo '<pre>';
    var_dump(headers_list());
echo '</pre>';
?&gt;
Do not use META cache control!

InsiteFX

#8
[eluser]crimsun[/eluser]
Thanks for your comment Insite...

I have rearranged the code as per you provide and make all changes. but still i face the same problem on safari browser..as i see when i logged in site the site set two cookies variable and after logged out only one cokkie variable destroy one is till there and if i use the browser back button then that another cookie variable get destroy and redirect to login page...this happened only for firefox,chrome,,,but In safari it should not destroy the cookie is still there..

Please suggest me any other solution for this...

Thanks in advance...
Sanjay

#9
[eluser]InsiteFX[/eluser]
Form what I read the bug is in the webkit that the browsers use.

Banks get around this bug so my guest is that it has something to do with https://
Because the banks use https://

InsiteFX

#10
[eluser]Unknown[/eluser]
hi

I met this issue on MAC OS 10.7.5 safari 6.0.5 and only MAC client safari.

Did this issue have any solution or disappear at new safari version?

thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.