I am using php based blog on NGINX server with FastCGI cache. Without this cache, it is easy to update pageviews with every page load for a specific url. When FastCGI cache is in action, pageviews aren't updated.
I am thinking to implement pixel based tracking, so when that page isn't in cache and gets a cache MISS, the request will hit the real page and then I can update pageviews with help of access logs(24 hr) of pixel.
Will this be good or can anyone suggest a better workaround to achieve this?
Cache-Control: private, no-cache, no-store, max-age=0
and then you should get a hit for every page load. To display the counter, you could set on your page a header such asCache-Control: public, max-age=600 s-max-age=600
, or better, use a bit sy Javascript to pull the data using AJAX.