From: Mark E. <Mar...@ua...> - 2004-12-17 05:23:05
|
Hello, Here is what I found and changed. I have not had time to research if this was the correct way to fix the problem. When no one responded to my initial post I thought that the problem may be specific to my hosting provider. I didn't want to post my changes since I really don't know what I am doing :-). At the same time since it now works ok for me I have not taken the time to find out if this fix is really needed. By default mantis writes out headers to prevent browsers from caching all the php pages. This is normally a good thing so the scripts always execute and you see new data. However, the caching tags are also honored when the back button is used to re-visit a page. Both Internet Explorer and FireFox had the same behavior in my testing. The headers are written out two locations. One is in core.php. These headers are wrapped with a check to $g_bypass_headers. There is a second place where the headers are output in meta_inc.php. There was no check in that file. I wrapped the output of the headers in meta_inc.php with the same check that is in core.php. I also changed the print methods so I could figure out how to fit them in the if statement. Then in bug_report_page.php I set the global $g_bypass_headers to true at the top of the file, before core.php is included. If you look at the page headers after the change the no-cache meta tags are no longer there. Now when you click back the page is reloaded from cache with all the data filled in. If this change is reasonable and someone wants to give me some advice on how to correctly share it with the developers I will give it a try. I did subscribe to the dev mailing list to try and get a feel for what I needed to do. I just seemed to be lacking the time to figure it out. Thanks, Mark meta_inc.php global $g_bypass_headers; if ( !isset( $g_bypass_headers ) ) { PRINT "<meta http-equiv=\"Pragma\" content=\"no-cache\" /> \n"; PRINT "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" /> \n"; PRINT "<meta http-equiv=\"Pragma-directive\" content=\"no-cache\" /> \n"; PRINT "<meta http-equiv=\"Cache-Directive\" content=\"no-cache\" /> \n"; PRINT "<meta http-equiv=\"Expires\" content=\"$t_content_expire\" /> \n"; } bug_report_page.php global $g_bypass_headers; $g_bypass_headers = 'true'; require_once( 'core.php' ); |