To speed things up when adding lots of nodes programmatically, it would be good to have an option not to clear the cache on each node_save - cache_clear_all can be called manually at the end of the batch insertion, instead.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | node_cache_flush_1.patch | 820 bytes | lilou |
| #3 | node_cache_flush.patch | 858 bytes | pancho |
| node_cache_flush.patch | 791 bytes | hickory |
Comments
Comment #1
drummThis probably won't be added to 5 since it is an API change.
We use TRUE instead of 1.
Comment #2
catchPresuming this is fixed by batch api.
Comment #3
panchoWhile this is still an API change and we're in API freeze again, I rerolled the patch (using TRUE instead of 1). Move this to D7 though.
edit: whoops, crossed! Can somebody confirm this is superseded by the batch API?
Comment #4
lilou commentedReroll.
Comment #5
moshe weitzman commentedActually, I prefer to move cache flush to the calling function (the form submit handler) and keeop node_save() as a pure APi function that doesn't clear cache or set messages and so on.
Comment #6
sun+1 for what moshe said
Comment #7
moshe weitzman commentedAnd, we got this done in D7.
Comment #9
Jochus commentedI'm afraid this is not the correct issue to ask the following question, but if somebody can point me to a better issue - be my guest?! :-)
Can somebody explain me why Drupal flushes the whole cache after a node has been saved?
We have a lot of content being added/updated, so our cache_block and cache_page gets flushed each +- 5 minutes. We are not able to build a proper set of cache entries. So Drupal is always rebuilding its cache :-( ...
Comment #10
moshe weitzman commentedWe do that because blocks like 'recent content' and 'recent comments' may be stale so we just flush whole page cache. yes, it is non-smart. see #636454: Cache tag support for improvements in d8
Comment #11
Jochus commentedmoshe,
Thanks for your answer!
#636454 has some great idea's!
Jochen