Performance issue – displaying a map causes several database updates
-
Hi, I found the following code:
$set = get_option( 'post_type_rules_flushed_mapster_wp_maps' );
if ( $set !== true ) {
flush_rewrite_rules( false );
update_option( 'post_type_rules_flushed_mapster_wp_maps', true );
}$setwill never be exactly equal totruebecause WP stores and returns it as the string"1"per https://developer.ww.wp.xz.cn/reference/functions/get_option/Flushing the rewrite rules is an expensive operation, and the following
update_option()call isn’t ideal either – really there should no be no database updates happening on a frontend request whenever it can be avoided because a spike in traffic could easily tie up resources and even take down a website.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Performance issue – displaying a map causes several database updates’ is closed to new replies.