New answers tagged

-1

Transient are not for caching, transients are not for caching, transients are not for caching (ok, got it out of my system now ;) ). Transient are for longish storage of some temporary results but by design they do not offer any predictability that you would want in a cache. If transients were almost good enough for you, then best way is to cache into an ...


2

In general no, there is no advantage in having two caching entities in the way of each request. But you should be careful and understand how the caching works. For example cloudflare do not cache your pages in a central repository but each data center has its on cache so in an edge case you might get many requests at the same time from all of them, or a bug ...


0

The head of your site is full of scripts. The site is loading pretty fast, but rendering is slow because the browser is first waiting for the last (external) script to arrive. The scripts in the head, after all, may contain stuff that changes the page. First thing to do is move scripts that have nothing to do with rendering (especially google analytics) from ...


0

You should never set an expiry for the HTML which is longer then few hours and never set expiry for logged in users at all. The reason is that while you can cache bust CSS, JS and even images, you just can't do it with HTML as users are accessing html URLs directly and you have no way to instruct them to go to a "fresher" ones. In you case ExpiresDefault ...


3

Unsurprisingly so since you tell browser to cache everything for 1 month by default (ExpiresDefault "access plus 1 month"). You should limit long caching times to static resources and leave pages served by WP out of it. My go to resource for .htaccess configuration is HTML5 Boilerplate. It works with WP nicely and correctly excludes web pages from ...


3

I agree with @Tom J Nowell: I'd suggest you remove it, or better yet just say "all rights reserved". But in the quest for answers, here's a suggestion using an option field to cache the years: /** * Get year range for posts. * * @return str */ function wpse_226627_get_copyright() { if ( ! $years = get_option( 'copyright' ) ) { $args ...


0

In nearly all of the case WP doesn't participate in serving static files. Its rewrite rules are typically configured to ignore them and let web server handle. Otherwise overhead of firing up PHP engine and WP core for each static request would be incredibly taxing. As such there is no mechanism in WP to deal with caching issues for static files (outside of ...



Top 50 recent answers are included