How do I make Firefox reload page when back button is pressed?

后端 未结 7 1757
萌比男神i
萌比男神i 2020-12-17 21:40

I have tried every combination and permutation of meta tags that are supposed to stop a page from being cached, but Firefox STILL caches the page! I just need the U

7条回答
  •  借酒劲吻你
    2020-12-17 22:39

    You may add the following PHP Code in your PHP Page.

    CodeIgniter Framework version:
    $this->output->set_header('Last-Modified:'.gmdate('D, d M Y H:i:s').'GMT');
    $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');
    $this->output->set_header('Cache-Control: post-check=0, pre-check=0',false);
    $this->output->set_header('Pragma: no-cache');
    

    PHP version:

    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');
    

    And also you may add following Java Script Code in Login/Master Page at Section:

    
    

    Compatibility verified in

    • Internet Explorer
    • Google Chrome
    • Mozilla Firefox
    • Opera

提交回复
热议问题