3

I have manually removed all aggregated css and js files from sites/default/files.

I would like Drupal to regenerate these, but it does not. Drupal is still looking for the old files, the ones I have deleted.

Clearing the cache does nothing.

How do I force Drupal to recognize that the files are missing and need to be recreated?

  • Double check that Drupal is able/has permission and has the correct folder owner/group to write to your folder. – No Sssweat Aug 4 '17 at 17:24
  • It definitely does. – Scott Joudry Aug 4 '17 at 21:18
  • You sure about the owner/group part? because you could have the correct write permissions but if owner/group is wrong then you cannot write. In addition, you could also try unchecking, saving, and then rechecking, saving the settings – No Sssweat Aug 5 '17 at 0:35
  • This has nothing to do with file or folder permissions. The files were created before by Drupal so it should be able to create them again, but it simply doesn't. Only "drush cr" seems to work, but that refreshes all other caches, which will temporary slow down the whole site. – ñull Mar 5 at 11:44
  • With "Clearing the cache does nothing" you mean the browser cache or the Drupal cache. Clearing the latter should definitely work! – ñull Mar 5 at 11:47
-1

In D7 you might want to clear also the variables drupal_js_cache_files and drupal_css_cache_files:

drush vdel drupal_js_cache_files && drush vdel drupal_css_cache_files

Other than that, do you have any other cache on top of drupal (varnish?). Your pages could be cached with the reference to the old JS files. Is your site broken (404 on CSS/JS files) or is it just referencing the old ones? Usually drupal regenerates aggregated files if it can't find it.

  • This is a D8 question. – ñull Mar 5 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.