1

I'm working on a text format filter module. Now, somehow Drupal keeps the node content in some cache that is not refreshed with drush cc all, which I would have hoped to "clear all cache". This is with Cache pages for anonymous users and Cache blocks disabled.

I wrote a little script that adds " " at the end of the node body, but even running that between two drush cc alls doesn't cut it, still with cache disabled. It's really strange. If I go to a page I haven't accessed yet, it will show me an old version what was filtered. So I'm tempted to now also let the script access the specific node over HTTP...

Is there an easy way to really clear all cache? I guess dropping and recreating all cache_* tables could cut it but that seems a bit convoluted.

4
  • Perhaps you're looking at a wrong cache? I don't think it's node related. Perhaps field cache, or filter cache. What did you define for cache for your filter's hook_filter_info? It defaults to TRUE.
    – Beebee
    Jan 19, 2015 at 14:48
  • Doesn't drush cc all clear all cache?
    – the
    Jan 19, 2015 at 15:21
  • 2
    I've tried looking for that info, but have been unsuccessful. It may not clear field or filter cache. Running drush cc gives you the following options: 1) All 2) Drush 3) Theme Registry 4) Menu 5) CSS-JS 6) Block 7) Module List 8) Theme List 9) Registry. If Option 1 (all) only clears the items 2-9 then it won't clear field or filter cache. I don't really know 100% how drush works or if it's this or something completely different that's causing your issue! Just trying to help :)
    – Beebee
    Jan 19, 2015 at 15:25
  • I'm not sure what's the "correct" way to do this. But you could try temporarily changing the configuration of the text format, e.g. by enabling an extra filter. I think to remember that this will trigger a recalculation of the filtered text.
    – donquixote
    Jan 21, 2015 at 20:18

1 Answer 1

1

"All" cache doesn't include the filter cache and if you are working with filters then that's the one you most likely want to clear.

You can clear the filter cache by truncating the cache_filter database table.

If you have drush at your disposal, you can run drush sqlq "truncate table cache_filter;" to get the intended result.

Please note, if you are using database prefixing you will need to add the prefix yourself, as the drush sql-query command executes the query exactly as provided.

1
  • 1
    Thanks for this! Quite crazy that drush cc all doesn't actually clear all cache.
    – the
    Apr 12, 2015 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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