-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apc file exists cache #54
base: master
Are you sure you want to change the base?
Conversation
Hi Mateu, this looks great. However, since Pantheon relies on this repository, I'd like to get some more feedback from them before giving it a . Paging @joshkoenig @davidstrauss @greg-1-anderson (not 100% sure who the point person should be) |
@@ -3834,6 +3834,7 @@ function _drupal_load_stylesheet($matches) { | |||
*/ | |||
function drupal_clear_css_cache() { | |||
variable_del('drupal_css_cache_files'); | |||
drupal_aggregated_file_flush('css'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flushing the cache for file existence should happen only after the deletions. Otherwise, it creates a race condition where the cache gets repopulated in a concurrent request with files that will end up deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I'll move the flushing right after:
file_scan_directory('public://css', '/.*/', array('callback' => 'drupal_delete_file_if_stale'));
@davidstrauss please re-review. |
@mateu-aguilo-bosch do we need a test case that simulates an expired APC cache item by calling apc_delete(), and then clearing caches? I don't see how the simpletest covers this issue (pasted from another ticket) - but it does look to be fixed in the actual code. Or does your test already fail if we run it against master? On a Drupal cache clear, CSS and JS that have not been modified in 30 days are removed (configurable, but I don't think we've changed this). The file_exist calls are cached for 24 hours. I think the issue is if:
|
Allow flushing the file_exists APC caches (and add static cache).
This will also add a test on that feature.