Support » Plugin: LiteSpeed Cache » Browser Caching Pagespeed Warning using Contact Form 7

  • Resolved jscrm

    (@jscrm)



    I have a contact form (powdered by the Contact Form 7 plugin) on a website.

    When running PageSpeed Insights, I get near perfect score but a warning is shown:

    Leverage browser caching for: https://domain.com/index.php/wp-json/contact-form-7/v1/contact-forms/2523/refill (expiration not specified)

    I have the Browser Cache option enabled on LSCache plugin. Is this the expected behaviour? Would it be possible to add browser cache to this request to achieve perfect score? 😉

    Report number: GMFRMXES

    • This topic was modified 1 year, 1 month ago by  jscrm.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Hai@LiteSpeed

    (@hailite)

    LOL I don’t think so as that refill action is done by CF7 by purpose. With browser cached it, it can’t hit PHP anymore. However, you can try to contact CF7 to see if it’s possible or not.

    hi guys. I have the same message. Did you get answer on your question?

    I have found the solution to fix this, go to Contact Form 7 Plugin Directory and then open JS folder inside that you will find file called scripts.js edit the file and find following code (line 35 to 37)

    if ( wpcf7.cached ) { wpcf7.refill( $form );}

    Edit this code to the following

    if ( wpcf7.cached ) { wpcf7.cached = 0;}

    or comment the code

    Issue fixed.

    Regards
    Sachin G.

    thank u @sachinghare

    if ( wpcf7.cached ) { wpcf7.refill( $form );}
    Edit this code to the following
    if ( wpcf7.cached ) { wpcf7.cached = 0;} it worked before, how about now, Contact Form 7 Version 5.0.5.

    Please advice!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.