Hello.

Currently, if Drupal uses cacheing, then opening a suburl will only increment the content's view counter, if JavaScript is available on the client side. If for example company policy forbids this, to prevent doubling the HTTP queries, then a server side solution is needed.
Is an option for this is available in the Drupal Core cacheing system? If not, if i send in a patch for this option, will it be merged by any chance?

Thanks in advance.

Comments

tch68k created an issue. See original summary.

hron84’s picture

Can you explain where it causes the described situation and how? Also could you please describe the environment where the issue appears?

Let the developers understand more well the problem itself. Of course, if the code meets the Drupal coding standard and the community approves the patch, it has a high chance to be merged. There is a number of examples in the Drupal Core that user patches applied even for a security issue. Just make it clear how the problem works, how can you trigger it and also tests would be more than preferred to prove the correctness of the patch.

ndobromirov’s picture

Status: Active » Fixed

If you have big-pipe enabled and configured to run correctly you can have 99.9%+ of the page cache-able in the dynamic cache and generate the counter dynamically every time through the mechanism of lazy builders and place-holders, once you mark this piece of the page as non-cache-able.

In that regard this is a supported use-case by Drupal's cache API, but you should thoroughly re-consider do you REALLY NEED to implement view counter in that way...

tch68k’s picture

@hron84: We're sitting on the very same particular forum, you're exactly know what the problem was.

@ndobromirov: Thank you for the detailed explanation.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.