How to allow client page caching in XC?

Ankhaa
2008-12-19
2013-04-25
  • Ankhaa
    Ankhaa
    2008-12-19

    Hi i have one more question.
    For example i have PageA, PageB.
    PageA have submitted values and have link to PageB. User goes to PageB throught PageA.
    After that user presses IE's(internet explorer) BACK button.
    Then IE shows Page cannot found error. And user presses F5(refresh) then IE prompts user about to resubmit page.

    I want to display PageA from client cache as usual when user clicks back button. In Firefox it's okay.

    I guess that by default xoopscube configured to no client cache, and want to allow client caching to particular module.

    Please correct me if i in wrong way.

     
    • Ankhaa
      Ankhaa
      2008-12-21

      I changed sendHeader funciton in  modules/legacyRender/kernel/Legacy_RenderSystem.class.php 

          function sendHeader($interval = 60)
          {
              $now = time();
              $pretty_lmtime = gmdate('D, d M Y H:i:s', $now) . ' GMT';
              $pretty_extime = gmdate('D, d M Y H:i:s', $now + $interval) . ' GMT';
             
              header('Content-Type:text/html; charset='._CHARSET);
              header("Expires: $pretty_extime");
              header("Last Modified: $pretty_lmtime");
              header("Cache-Control: private,max-age=$interval,s-maxage=0");

          }

      to

          function sendHeader($interval = 60)
          {
              $now = time();
              $pretty_lmtime = gmdate('D, d M Y H:i:s', $now) . ' GMT';
              $pretty_extime = gmdate('D, d M Y H:i:s', $now + $interval) . ' GMT';
              // Backwards Compatibility for HTTP/1.0 clients
              header("Last Modified: $pretty_lmtime");
              header("Expires: $pretty_extime");
              // HTTP/1.1 support
              header("Cache-Control: private,max-age=$interval,s-maxage=0");
          }

      but page header values not changing :(
      Where should i change header values in xoopscube?

      Thanks.

       
    • Ankhaa
      Ankhaa
      2008-12-21

      Lol i found it,
      there was one more sendHeader function Legacy_RenderTarget.class.php . I changed it to allow client cache and now when user presses ie's back button browser reads page from client cache. But is there any side effects(conflicts) in the future and with other modules?