• Hi,

    I’m on the latest version of WordPress and all plugins/themes are up to date.

    I use WPML which has impacted over plugins in the past.

    I’ve noticed the precache timestamp at the bottom of the page always reports the homepage as being made fresh from that page load and isn’t saved like other pages.

    Any reason for this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,
    I have the same problem, with and without WPML. Only the homepage is affected.
    My configuration is nothing too special, using the Enfold Theme and WooCommerce.
    Per

    jomo

    (@jonathanmoorebcsorg)

    +1 same problem.
    Further, when turning on caching on a child site, supercache caches the front page of the child site instead of the main site…

    You should all enable debugging in the plugin, and see what the plugin reports it’s doing when you visit the front page of your respective sites.

    jomo

    (@jonathanmoorebcsorg)

    yes, I wondered about this and tried it, get eg:

    
    21:24:45 13962 / wp_cache_get_cookies_values: return: 
    21:24:45 13962 / wp_cache_get_cookies_values: return: 
    21:24:45 13962 / wpsc_get_realpath: directory does not exist - /home/myblog/public_html/wp-content/cache/blogs/blog/meta/
    21:24:45 13962 / supercache dir: /home/myblog/public_html/wp-content/cache/supercache/www.myblog.com/
    21:24:45 13962 / No Super Cache file found for current URL: /home/myblog/public_html/wp-content/cache/supercache/www.myblog.com/index-https.html
    21:24:45 13962 / wp_cache_get_cookies_values: return: 
    21:24:45 13962 / wpsc_get_realpath: directory does not exist - /home/myblog/public_html/wp-content/cache/blogs/blog/meta/
    21:24:45 13962 / In WP Cache Phase 2
    21:24:45 13962 / Setting up WordPress actions
    21:24:45 13962 / Created output buffer
    21:24:45 13962 / wp_cache_get_cookies_values: return: 
    21:24:45 13962 / wpcache_do_rebuild: doing rebuild for /home/myblog/public_html/wp-content/cache/supercache/www.myblog.com/
    21:24:45 13962 / wpsc_get_realpath: directory does not exist - /home/myblog/public_html/wp-content/cache/blogs/blog/index.html
    21:24:45 13962 / wpsc_get_realpath: directory does not exist - /home/myblog/public_html/wp-content/cache/blogs/blog/meta
    21:24:45 13962 / wpsc_get_realpath: directory does not exist - /home/myblog/public_html/wp-content/cache/blogs/blog/meta/index.html
    21:24:46 13962 / DONOTCACHEPAGE defined. Caching disabled.
    21:24:46 13962 / wp_cache_maybe_dynamic: returned $buffer
    

    not sure why it is looking for /cache/blogs/blog/ and /cache/blogs/blog/meta/ – creating these directories made no difference to the result.

    You need to debug to find the offending code which is forcing DONOTCACHEPAGE on the front page, in my case its Polylang, if the option for detect browser language is enabled.

    
    	/**
    	 * Informs cache plugins not to cache the home in the default language
    	 * When the detection of the browser preferred language is active
    	 *
    	 * @since 2.3
    	 */
    	public function do_not_cache_site_home() {
    		if ( ! defined( 'DONOTCACHEPAGE' ) && PLL()->options['browser'] && PLL()->options['hide_default'] && is_front_page() && pll_current_language() === pll_default_language() ) {
    			define( 'DONOTCACHEPAGE', true );
    		}
    	}
    

    So you can choose – if you want requests for the home page to automatically redirect the user to the appropriate version of the site, in this case from the browser Accept-Language, then you might not cache the default language home page..

    WPML is probably a similar case..

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Preload not working on homepage’ is closed to new replies.