Make WordPress Core

Ticket #3059: wp-cache-js.diff

File wp-cache-js.diff, 2.7 KB (added by masquerade, 19 years ago)
  • wp-includes/js/autosave.js.php

     
    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 = '';
    115function autosave_timer() {
  • wp-includes/functions.php

     
    737737        @ header('Pragma: no-cache');
    738738}
    739739
     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");
     745}
     746
    740747function get_num_queries() {
    741748        global $wpdb;
    742749        return $wpdb->num_queries;
  • wp-admin/cat-js.php

     
    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;});
    66addLoadEvent(newCatAddIn);
  • wp-admin/list-manipulation-js.php

     
    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?>
    66addLoadEvent(function(){theList=new listMan();});
  • wp-admin/dbx-admin-key-js.php

     
    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'] ) :
    66        case 'post.php' :