Currently the syntax-highlighted markup gets cached in a transient every time a modification is made, unless in development mode:
|
if ( ! DEVELOPMENT_MODE ) { |
|
set_transient( $transient_key, compact( 'content', 'attributes' ), MONTH_IN_SECONDS ); |
|
} |
This can cause quite a few throw-away transients to build up in the course of editing a post. I suggest we add an is_preview() to the conditions, so it only caches the result when viewing the post in a non-preview context.
It would also be good to warm the cache upon save_post so that a frontend request is less prone to involve a cache miss.
Currently the syntax-highlighted markup gets cached in a transient every time a modification is made, unless in development mode:
syntax-highlighting-code-block/syntax-highlighting-code-block.php
Lines 632 to 634 in 85bb16b
This can cause quite a few throw-away transients to build up in the course of editing a post. I suggest we add an
is_preview()to the conditions, so it only caches the result when viewing the post in a non-preview context.It would also be good to warm the cache upon
save_postso that a frontend request is less prone to involve a cache miss.