Make WordPress Core

Changeset 4109


Ignore:
Timestamp:
08/22/2006 05:31:53 PM (18 years ago)
Author:
ryan
Message:

cache_javascript_headers() from masquerade. fixes #3059 #2799

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/cat-js.php

    r3684 r4109  
    11<?php
    22require_once('../wp-config.php');
    3 header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true);
     3cache_javascript_headers();
    44?>
    55addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;});
  • trunk/wp-admin/dbx-admin-key-js.php

    r3830 r4109  
    11<?php
    22require_once('admin.php');
    3 header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true);
     3cache_javascript_headers();
    44
    55switch ( $_GET['pagenow'] ) :
  • trunk/wp-admin/list-manipulation-js.php

    r4069 r4109  
    11<?php
    22require_once('admin.php');
    3 header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true);
     3cache_javascript_headers();
    44$handler =  get_settings( 'siteurl' ) . '/wp-admin/admin-ajax.php';
    55?>
  • trunk/wp-includes/functions.php

    r4091 r4109  
    736736    @ header('Cache-Control: no-cache, must-revalidate, max-age=0');
    737737    @ header('Pragma: no-cache');
     738}
     739
     740function cache_javascript_headers() {
     741    $expiresOffset = 864000; // 10 days
     742    header("Content-type: text/javascript; charset=" . get_bloginfo('charset'));
     743    header("Vary: Accept-Encoding"); // Handle proxies
     744    header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT");
    738745}
    739746
  • trunk/wp-includes/js/autosave.js.php

    r4107 r4109  
    11<?php @require_once('../../wp-config.php');
    2 $expiresOffset = 3600 * 24 * 10;        // 10 days util client cache expires
    3 
    4 header("Content-type: text/javascript; charset: UTF-8");
    5 header("Vary: Accept-Encoding"); // Handle proxies
    6 header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT");
    7 
    8 
     2cache_javascript_headers();
    93?>
    104var autosaveLast = '';
Note: See TracChangeset for help on using the changeset viewer.