• gogosjon

    (@gogosjon)


    Hello,

    I am using your really awesome plugin since several weeks now! The load time is crazy! It works perfectly except one little thing: After about 24h of cache time I get 403 forbidden errors when I access my page. The error says:

    admin-ajax.php Failed to load resource: the server responded with a status of 403 (Forbidden)

    I can reproduce this error by installing cache enabler on a other wordpress installation.

    This causes erros with ajax plugins (kk Star Ratings) and sometimes a problem with my ajax page loading. Could it be that cache enabler caches the csrf token?

    Site with error: https://exhaustdb.com

    Thank you very much for your help! Keep up the awesome work!
    Greetings

Viewing 15 replies - 1 through 15 (of 19 total)
  • codyarsenault

    (@codyarsenault)

    Does clearing the CE cache solve the problem? Also do you have .php included in your list of exclusions? You may want to also try excluding your ajax plugins folders from CE to test if this is in fact the cause.

    Thread Starter gogosjon

    (@gogosjon)

    Hello,
    thank you for your very fast answer! I included the .php and the plugin folder (also the star rating plugin) inside the exclusion list. After 24h I get the same forbidden error again. Clearing cache manually works. I will test the automatic cache clear option and report later.

    Thread Starter gogosjon

    (@gogosjon)

    Both solutions did not work … The cache gets cleared and regenerated but the problem is still existing. Excluding also did not work. Do you have other ideas?

    Thank you very much!

    Thread Starter gogosjon

    (@gogosjon)

    Any idea?

    Greetings

    I have the same problem too, on two different sites running Cache Enabler.

    Do the dev’s have any more to add on this?

    @thpstock do you also have the kkstar plugin? If not, have you tried running a test will all other plugins disabled to rule out whether or not this might be a plugin conflict issue?

    No I don’t have the kkstar plugin. I tried disabling plugins and found cache enabler (to the best that I can determine) was the cause.

    I have had this issue on a few sites. Here’s one client site that has this problem when using a ‘load more’ feature of a gallery: https://www.artworksframing.com.au/australian-photos/

    I have now told Cache Enabler to bypass caching for this page (and other gallery pages) using the page id, so now it loads correctly. Without those rules entered I hit a “admin-ajax.php Failed to load resource: the server responded with a status of 403 (Forbidden)” when clicking on the Load More button at the bottom of the gallery.

    Any ideas on why its actually causing this problem though would be good.

    • This reply was modified 6 years, 7 months ago by THP Studio.

    Do you have any security plugins active? Additionally, can you check if there is an .htaccess file present in either (or both) the /wp-content/ or /wp-content/cache/ directories when the 403 error occurs?

    I have Wordfence which I initially thought was the problem. But turns out its not.

    I have a htaccess file which is pretty standard really.

    Ok let me try something so we can work this out:

    All gallery pages on the site I linked to above have been excluded from CE plugin.

    However, I have now removed the exclusion for this one: https://www.artworksframing.com.au/photos-by-melanie-smith/

    So give it some time for the cache to kick in, and in theory all the gallery’s load more buttons should work EXCEPT for the page just listed above if CE is actually the problem.

    Make sense? I have been trying to debug this issue for a while and only thought of this now πŸ™‚

    I just checked the page you linked however do not see any errors when clicking the load more button. I also see that Cache Enabler is delivering that page. Are you still able to reproduce this issue?

    Hey,

    So I just checked and this page: https://www.artworksframing.com.au/photos-by-melanie-smith/ – I can’t get the Load More button to work.

    Safari reports: [Error] Failed to load resource: the server responded with a status of 403 (HTTP/2.0 403) (admin-ajax.php, line 0) and I get the same error in Chrome as well.

    On the other gallery pages such as this one: https://www.artworksframing.com.au/murray-bridge-images/ – it works for me.

    Which seems to confirm my theory as the first link is running through Cache Enabler, whereas the 2nd link should be excluded from it.

    Mind trying it again at your end?

    And thanks for trying to help out with this issue.

    • This reply was modified 6 years, 7 months ago by THP Studio.
    • This reply was modified 6 years, 7 months ago by THP Studio.

    I’m able to replicate it now. Can you provide a screenshot of your current Cache Enabler plugin settings?

    https://ibb.co/iPHddw

    That should show you the settings.

    It’s likely that Cache Enabler is caching the nonce (security token) value therefore once it expires, the 403 error occurs. The lifespan of a nonce is 12 hours by default so you’ll need to set a cache expiry time less than whatever value the expiry of your nonce is. You mentioned the issue starts occurring around the 24 hour mark so setting the CE expiry value to 23 should work.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Admin-ajax.php 403 forbidden with Cache Enabler after 24h’ is closed to new replies.