Changeset 553


Ignore:
Timestamp:
Dec 15, 2015 9:40:29 PM (8 years ago)
Author:
anonymous
Message:

Minor change to caching of JS and CSS.

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r551 r553  
    13301330    * @access   public
    13311331    * @param    string  $id             Identifier for this script.
    1332     * @param    mixed   $carry_args     Additional arguments to carry in the URL automatically (see $app->oHREF()).
     1332    * @param    mixed   $carry_args     Additional arguments to carry in the URL automatically (see $app->url()).
    13331333    * @param    string  $default_url    A default URL if there is not a valid specified boomerang URL.
    13341334    * @param    bool    $queryless_referrer_comparison   Exclude the URL query from the refererIsMe() comparison.
  • trunk/lib/CSS.inc.php

    r502 r553  
    3939        'character_set' => 'utf-8',
    4040        'cache_css' => false,
     41        'cache_seconds' => 86400,
    4142        'strip_whitespace' => false,
    4243        'output_compression' => false,
     
    140141
    141142        if ($this->getParam('cache_css')) {
    142             header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $latest_mtime) . ' GMT');
    143             header('Cache-Control: public, max-age=86400');
     143            header(sprintf('Last-Modified: %s GMT', gmdate('D, d M Y H:i:s', $latest_mtime), null));
     144            header(sprintf('Cache-Control: public, max-age=%s', $this->getParam('cache_seconds')));
    144145            header('Pragma: public');
    145146        } else {
  • trunk/lib/JS.inc.php

    r502 r553  
    3939        'character_set' => 'utf-8',
    4040        'cache_js' => false,
     41        'cache_seconds' => 86400,
    4142        'strip_whitespace' => false,
    4243        'output_compression' => false,
     
    140141
    141142        if ($this->getParam('cache_js')) {
    142             header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $latest_mtime) . ' GMT');
    143             header('Cache-Control: public, max-age=86400');
    144             header('Pragma: public');
     143            header(sprintf('Last-Modified: %s GMT', gmdate('D, d M Y H:i:s', $latest_mtime), null));
     144            header(sprintf('Cache-Control: private, max-age=%s', $this->getParam('cache_seconds')));
     145            header('Pragma: private');
    145146        } else {
    146147            header('Expires: -1');
Note: See TracChangeset for help on using the changeset viewer.