Support » Plugin: Custom Contact Forms » CCF Not Cache Friendly

  • Just a note –

    The implementation of CCF forces caching to be bypassed even on pages WITHOUT forms.

    This is easily fixed. The file you need to edit is: custom-contact-forms-front.php

    Comment out line 16 by putting a # in front – it should read:

    # ccf_utils::startSession();



    After the line that reads (about line 198 or so):

    function getFormCode($form, $is_widget_form = false) {

    And that should do it!


    The function ccf_utils::startSession() creates a PHP session and sends back a cookie to the browser. This is needed for things like CAPTCHA and other features.

    Because of the cookie for the PHP session, headers are sent back to the browser and the caching servers to prevent caching of the page.

    Because ccf_utils::startSession() is in frontInit, a session is created on EVERY PAGE. However, it ISN’T needed when there is no form on the page.

    Making the changes above means that a session is only initiated if/when there’s a form on the page.

    Hope that helps others trying to make their site as speedy as possible

  • The topic ‘CCF Not Cache Friendly’ is closed to new replies.