Admin area is caching posts in the editor
Admin area is caching posts in the editor
Admin area is caching posts in the editor
I think you should in this case use echo: function print_script() { echo ‘<script type=”text/javascript”> window.onload = function () { var loadTime = window.performance.timing.domContentLoadedEventEnd-window.performance.timing.navigationStart; alert(loadTime); console.log(loadTime); } var var1 = <?php echo json_encode(‘var1’); ?>; var var2 = <?php echo json_encode(‘var2’); ?>; var var3 = <?php echo json_encode(‘var3′); ?>; </script>’; } add_action(‘wp_print_scripts’, ‘print_script’);
admin-ajax.php 403 errors – no caching, permissions are fine
If you check the source code for get_option, you’ll see that it already uses wp_cache_get() and wp_cache_add() under the hood. So without looking deeper into the implementation, I would presume that two calls of get_option(‘foo’); would only trigger a single db call (and cache the result). Hence, in this case E) would apply: caching is … Read more
It’ entirely possible that WordPress detects the device based on the User-Agent requests header and displays the right version of the website accordingly. If you don’t instruct Varnish to create a cache variation depending on the device, only one version will be cached per page. Device detection Varnish is able to perform device detection by … Read more
Use the save_post hook to check if a post that is being saved is a portfolio page and reset the transient. add_action( ‘save_post’, ‘reset_portfolio_transient’, 10,3 ); function reset_portfolio_transient( $post_id, $post, $update ) { // Only set for portfolio post_type if ( ‘portfolio’ !== get_post_type($post) ) { return; } // delete old tranisent delete_transient( ‘randomizeProfiles’ ); … Read more
If you have any kind of caching enabled on a site with WordPress, IMHO, it’s probably best to use cookies instead of session variables, because with caching enabled, the user’s request for a page may not even hit the server at all — so the session var isn’t even being read. What I typically do … Read more
How to speed up post list slowed by update_meta_cache()?
It turns out that the folder wp-content/mu-plugins, for whatever reason, didn’t contain plugins, but instead a dump of broken copies of most pages on the site, as well as an outdated copy of the entire public_html directory, with another plugins folder nested inside of it, etc! How that happened is beyond me, but simply removing … Read more
Changing cache update rate