Make WPRM rating System Page Cache Friendly!
-
Hi,
With the current version of WPRM, if someone is using the rating system, it has a great flaw which is causing issues with full page caching, especially if the page is cached at the CDN level.
So, currently, if a recipe card is using the rating system and when the page is cached, and if I go ahead and add a rating it uses
admin-ajax.phpto update the rating — this is great.But when I reload the page, the cached page will still show the old ratings instead of showing the latest ratings. This is because inside
<div class="wprm-recipe-rating-details wprm-block-text-normal"> <span class="wprm-recipe-rating-average">5</span> from <span class="wprm-recipe-rating-count">2</span> votes </div>The rating calculation is done at the PHP level. So, when the page is being served from cache and PHP is not getting executed, these values are not the latest values.
It would be great if you could add another
admin-ajax.phpcall for fetching the rating data. In this way, even if the page is cached, theadmin-ajax.phpwill fetch the current data of the rating and will be shown inside the recipe card.So, the data inside the
wprm-recipe-rating-averageandwprm-recipe-rating-countclasses needs to come from JS and not from PHP. This will make this plugin highly compatible with all page caching systems.Thanks.
The topic ‘Make WPRM rating System Page Cache Friendly!’ is closed to new replies.