Setting Last Modified HTTP Header on static Home Page

Last-Modified header for visitors on the front-page It’s useful to see how the Last-Modified header is added to the feeds, in the wp::send_header() method. If we want to be able to use is_front_page(), then the filters wp_headers or send_header are probably applied to early. We could instead use the template_redirect hook to target the front-page, … Read more

My WordPress site always displays a cached version of its homepage

Sounds like your expires headers are set to far in the future. The following rules can be added to your .htaccess Expires rules can be added to your Nginx server file to shorten the expires time down to 180 seconds. location ~* \/[^\/]+\/(feed|\.xml|.html|.HTML)\/? { expires 180; } I would also suggest installing the Nginx Proxy … Read more

Exclude certain block from caching using Fragment Caching – doesn’t work [closed]

From the source: Here (source) is the mfunc part in the 0.9.2.9 version of the W3TC plugin where the regular expression is: $buffer = preg_replace_callback(‘~<!–\s*mfunc\s*’ . W3TC_DYNAMIC_SECURITY . ‘(.*)–>(.*)<!–\s*/mfunc\s*’ . W3TC_DYNAMIC_SECURITY . ‘\s*–>~Uis’, array( &$this, ‘_parse_dynamic_mfunc’ ), $buffer); From this it looks like the setup should be <!– mfunc W3TC_DYNAMIC_SECURITY code1–> code2 <!– /mfunc W3TC_DYNAMIC_SECURITY … Read more

Duplicate Queries

Generally speaking, you could use the WP Transients API to save the query. // Get any existing copy of our transient data if ( false === ( $special_query_results = get_transient( ‘special_query_results’ ) ) ) { // It wasn’t there, so regenerate the data and save the transient $special_query_results = new WP_Query( ‘cat=5&order=random&tag=tech&post_meta_key=thumbnail’ ); set_transient( ‘special_query_results’, … Read more

How would implement StackExchange ‘Questions with similar titles’ for the FAQ on my wordpress site

The communication with the server happens via Ajax. I once wrote a high-level overview of Ajax in WordPress, but you can find many more examples on this site and around the web. Next, you have to do a query that will find similar titles. I found some questions that might help you on Stack Overflow: … Read more