Summary

When enabled global configuration cache and enabled system cache extension, article hits-counter doesn't work properly.

please help.
Opened On:
15 Dec 2012, 10:39 by Mert Demiray
Closed On:
13 Mar 2013, 2:53
Status:
Known Issue

Filed Under

  • Apache 2.0.x
  • MySQL 5.2.x
  • No Platform Implications
  • PHP 5.3.x
  • Platform

Responses

Posted on 13 Mar 2013, 2:13 by Paul van Jaarsveld
I am encountering the same issue. Client is very happy with performance increase due to cache on a very large website, but reports that the hitcounts are very low for breaking news articles compared to before cache was switched on. Also, the users online in the backend is not accurate either. Looking into this.
Posted on 13 Mar 2013, 2:53 by Brian Teeman
This is a known issue and a consequence of the cache. As pages are being served by the cache and not joomla there iw no way for joomla to count them (same with users online)
Posted on 13 Mar 2013, 13:59 by Mert Demiray
No such thing as absolutely impossible. If there would be a pity so much knowledge of a method must be found. I think this is a good computer aided software engineer can handle the job. Function may be the solution to adding a little change believe.
Posted on 21 Feb 2014, 9:56 by Brad Markle

I know this is an older post, but I encountered a similar problem. Just wanted to post how I was able to increase the hit counter when caching is enabled.

For articles, I added an ajax call to a script named increase_hits.php. Even if the page being served is a cached copy, it will include the javascript to make the ajax call and increase the hits.

You can see a working example here - http://www.inmotionhosting.com/support/edu/cpanel/getting-started-cpanel/how-to-log-into-cpanel

If you look at the source, you'll see code like this:

<script type='text/javascript'>

jQuery.post('/support/includes/increase_hits.php',

{

option:'com_content',

view:'article',

id:'970'

});

</script>

 

The increase_hits.php script only needs some data validation to protect against hack attempts, and then a quick query to actually increase the hits for the article in question.

 

The last thing to do was to disable the hits from increasing within a core file (yes, don't mess with core files).