Skip to content

Instantly share code, notes, and snippets.

@Rarst
Created February 20, 2013 19:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rarst/4998413 to your computer and use it in GitHub Desktop.
Save Rarst/4998413 to your computer and use it in GitHub Desktop.
Black magic, probably breaks something.
<?php
r_cache_scripts();
function r_cache_scripts() {
if ( is_admin() )
return;
global $wp_scripts;
$scripts = get_transient( 'r_cache_scripts' );
if ( empty( $scripts ) ) {
$wp_scripts = new WP_Scripts();
wp_default_scripts( $wp_scripts );
set_transient( 'r_cache_scripts', $wp_scripts );
}
else {
$wp_scripts = $scripts;
}
}
@tomjn
Copy link

tomjn commented Mar 7, 2013

What kind of speed ups did this give? Aside from any broken-ness that happened

@Rarst
Copy link
Author

Rarst commented Apr 14, 2013

@tarendai don't remember the numbers. Not a thing to worry about until you get in <100ms realm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment