Skip to content

Instantly share code, notes, and snippets.

@SupermanScott
Created March 24, 2010 20:08
Show Gist options
  • Save SupermanScott/342721 to your computer and use it in GitHub Desktop.
Save SupermanScott/342721 to your computer and use it in GitHub Desktop.
//fetches all JS src and concats them
// md5() the above
// On click / form submit add ID from above
$js_page_id = $_POST['js_page_id'];
$files_in_parent = cache_get($js_page_id, 'cache');
hook_preprocess_page() {
foreach (drupal_add_js() as $type => $data) {
if ($type == 'file') {
foreach $data as $path => $info {
$paths .= base_path() . $path;
$js_files[] = $info;
}
}
}
$js_page_id = md5($paths);
cache_set($js_page_id, $js_files);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment