LiteSpeed Cache Plugin Adversely Affects Article View Counts

#1
I was using the LS Cache Plugin for my site while it was running on Joomla 3. I have now migrated to J4 and I have not been using the plugin up to now. One thing I noticed when previously using it was that the article hit counts shown in admin were massively under reported, I guess because the site was recording multiple views of a cached page as a single view.

Is there any way to solve this in Joomla 4?
 

serpent_driver

Well-Known Member
#2
Is there any way to solve this in Joomla 4?
If the function for counting hits no longer works, then it is not a bug, but the consequence of a page cache. A cached URL is just a static HTML page in which you can no longer run PHP. This means that user requests can only be counted as long as a URL has not yet been cached. Although LScache provides functions to exclude individual areas of a URL from caching, these functions cannot be used in this specific case. You will therefore have to look for another function in order to be able to record the hits. Preferably this should be an AJAX driven function.
 
#3
Thank you. I wasn't suggesting it was a bug, I expected that the nature of caching pages would result in this so I will look for an alternative method of recording user requests as suggested.
 

AndreyPopov

Well-Known Member
#4
@DJBenz number of page requests must be stored in DB.
LSCache only redirect request to page from dynamic generate to saved in cache static html version.
static html version of page show "number of views" at time when it created.

until you create new version (renew) page in lscache "number of views" no change.


I use Opencart CMS, but I think Joomla use same technics.
 
Top