Stylesheet switching and caching

I use W3TC, so these are approaches that I can come up with it for it: Fragment caching to exclude that part of page, will reduce cache effectiveness overall. Identify page with switched stylesheet by query argument, disable caching of such pages. Identify page with switched stylesheet by URL endpoint, disable caching of such by … Read more

Which WordPress pages/URLs should never be cached?

You should not cache anything in the admin so your examples are correct. A typical nginx reverse proxy cache is set to ignore wp\-.*\.php|wp\-admin Another option is to not cache logged in users by checking the wp cookies, but you probably don’t have that level of control. ps. It is highly advisable you test this … Read more

WordPress transients for a shortcode

Use this instead of the line in wich you define $days (your second line): $transient = get_transient( ‘your_transient_key’ ); if( !$transient ): $days = file_get_contents( ‘json_file’ ); set_transient( ‘your_transient_key’, $days, DAY_IN_SECONDS*7 ); else: $days = $transient; endif; $days = json_decode( $days ); … May be a bit rough but you get the idea.

WP script versioning breaks cross-site caching?

Use null as $ver param: wp_deregister_script( ‘jquery’ ); wp_register_script( ‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js’, false, null); wp_enqueue_script(‘jquery’); Output: <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js”></script>

Any reason why wp_cache_set not to work?

The wp_cache_*() functions are non-persistent caches which means that they only last during the current page request. This would be beneficial if you’re requesting the same information multiple times during page load. For example, if you’re showing recent posts in the header, content section, and sidebar ( calling the same code 3 times to retrieve … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)