bluehost / endurance-page-cache

Other
24 stars 11 forks source link

Prevent AJAX short circuit #63

Closed earnjam closed 5 years ago

earnjam commented 5 years ago

Currently the Endurance_Page_Cache class returns immediately on in __construct() when DOING_AJAX is defined. This prevents the .htaccess file from being updated through AJAX requests, including the Bluehost > Performance page in the WordPress admin because the proper action/filter hooks are never registered.

This simply moves this check to the is_cachable() (spelling is wrong, btw) function. This will make sure that any ajax requests aren't considered cachable, but ajax calls can still be used for cache purging or setting change purposes.