• Resolved emahajan

    (@emahajan)


    Hi,

    I really liked this plugin and really appreciate the efforts taken by developers.
    In my website I want to keep my homepage dynamic i.e. no-cache need to be there.

    In ‘URLs to exclude from cache’ I added / and /index.php still homepage is getting cached.
    As on homepage left side bar I want to display logged-in username, however its not getting displayed. Same username is getting displayed on the inner non-cached product listing page.

    I really appreciate the feedback on this.

    Thank you.

    • This topic was modified 5 years, 6 months ago by emahajan.
    • This topic was modified 5 years, 6 months ago by emahajan.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    If you need a username to be displayed when logged in, you should disable the option “Serve cached pages to logged in users”.

    If you want to exclude the front page from cache, you can add the following code somewhere:

    
    add_action('init',
    	function() {
    		if (is_front_page() && !defined('DONOTCACHEPAGE')) {
    			define('DONOTCACHEPAGE', true);
    		}
    	}
    );
    

    Marc.

    Thread Starter emahajan

    (@emahajan)

    Thank you Marc, will check and let you know.

    Thread Starter emahajan

    (@emahajan)

    Hello Marc,

    I added above mentioned code in theme’s function.php…However, still, its caching the homepage and serving the same cached page to visitors.

    Please assist on this.

    • This reply was modified 5 years, 5 months ago by emahajan.

    Hi,

    Sorry, it seems add_action('init', doesn’t work, but add_action('wp', should. (You’ll have to clear the cache for the frontpage)

    Marc.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Exclude Homepage from Caching’ is closed to new replies.