• Hi,
    I’m using this plugin on my site. I found after a day wp-admin/admin-ajax.php gets 403 error and all Ajax functionality on site stop working. removing cache of Autoptimize fix the problem but after a day, this problem occurs again.

    I disabled javascript minification but it doesn’t help.

    I have installed WP Super Cache and All In One WP Security too.

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

    (@optimizingmatters)

    Hi @arshen;
    Can’t be 100% certain, but this is probably rather a problem with page caching (wp super cache); typically admin-ajax.php requests use a “nonce”, a semi-random string which is generated and added to the page. When the ajax gets triggered it sends that “nonce” (together with the data it tries to post) to the server where the nonce gets checked. Now the problem; a WordPress nonce has a limited validity, typically (but not always) 4h. If the “nonce” does not check out, the request is refused, which is what you’re observing.

    The solution; lower “Cache Timeout” on WP Super Cache’s “Advanced” tab. The default there is 3600s (= 1h), so either you have a (much) higher value there OR you have a plugin which has a _very_ short nonce lifetime.

    Hope this clarifies/ helps,
    frank

    Thread Starter Foad Tahmasebi

    (@arshen)

    Thank you so much, I’ll check it and inform you.

    Thread Starter Foad Tahmasebi

    (@arshen)

    I decreased cache timeout and the problem solved.
    Thank you.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Happy you got it working @arshen. Feel free to leave a review of the plugin (and support) here! 😉

    have a nice weekend,
    frank

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cause admin-ajax.php 403 forbidden’ is closed to new replies.