Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions includes/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3448,7 +3448,7 @@ function drupal_build_css_cache($css) {
$uri = $map[$key];
}

if (empty($uri) || !file_exists($uri)) {
if (empty($uri) || !drupal_aggregated_file_exists($uri)) {
// Build aggregate CSS file.
foreach ($css as $stylesheet) {
// Only 'file' stylesheets can be aggregated.
Expand Down Expand Up @@ -4776,6 +4776,20 @@ function drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgro
drupal_add_js($settings, 'setting');
}

function drupal_aggregated_file_exists($uri) {
if (function_exists('apc_fetch')) {
$exists = apc_fetch('file_exists_' . $uri);
if (!$exists && file_exists($uri)) {
$exists = TRUE;
apc_store('file_exists_' . $uri, TRUE, 86400);
}
}
else {
$exists = file_exists($uri);
}
return $exists;
}

/**
* Aggregates JavaScript files into a cache file in the files directory.
*
Expand Down Expand Up @@ -4809,7 +4823,7 @@ function drupal_build_js_cache($files) {
$uri = $map[$key];
}

if (empty($uri) || !file_exists($uri)) {
if (empty($uri) || !drupal_aggregated_file_exists($uri)) {
// Build aggregate JS file.
foreach ($files as $path => $info) {
if ($info['preprocess']) {
Expand Down