• Resolved wlltat

    (@wlltat)


    Hi,
    Your plugin has really helped me improve page speed scores. Thank You.

    I have a page on my website where there is an online quiz.
    Caching affects the results.

    How can I EXCLUDE this SINGLE PAGE from being cached?
    (I still want other pages to be cached.)

    I have read your FAQa. There is an option to exclude js, css and whole plugins from being cached. But I wanted to get help regarding just one single page.

    Thank You very much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    That can be done with a couple of lines of code, here’s an example that stops AO on URL’s that have “/online-quiz” in them;

    add_filter('autoptimize_filter_noptimize','noptimize_quiz',10,0);
    function noptimize_quiz() {
    	if (strpos($_SERVER['REQUEST_URI'],'/online-quiz')!==false) {
    		return true;
    	} else {
    		return false;
    	}
    }

    hope this helps,
    frank

    Thread Starter wlltat

    (@wlltat)

    Where should I add this code please?

    Also url of the quiz page is something long. Should I replace /online-quiz with that URL?

    Thank You.

    @wlltat Add the code in your functions.php file. Before the closing ?> tag.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Should I replace /online-quiz with that URL?

    yes ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can I exclude a SINGLE PAGE from being cached please?’ is closed to new replies.