Downloads counter not reliable - #278
Conversation
| <div class="title"> | ||
| <i class="fa <?= $row->getIconClass(); ?>"></i> | ||
| <?php if ($row->getType() === "image") : ?> | ||
| <?php $galleryOptions = Yii::$app->getModule('cfiles')->settings->get('displayDownloadCount', false) |
There was a problem hiding this comment.
Can you please explain this? Why do we have different galleryOptions when the download counter is activated?
There was a problem hiding this comment.
@luke- used to disable image cache by gallery plugin
| return; | ||
| } | ||
|
|
||
| $event->action->enableHttpCache = false; |
There was a problem hiding this comment.
I would actually prefer not to disable caching when the download counter is enabled.
In my opinion, it is not a problem if the download counter does not increase when the user already has the file in their cache.
| return; | ||
| } | ||
|
|
||
| $deduplicationKey = [ |
There was a problem hiding this comment.
I like the idea, to use the cache, to avoid tracking multiple times.
Basically, I don't think it's a bad idea if a user who has already downloaded the file is not counted again.
So what do you think about simply saving “trackedDownloads = [ids]” in the current user session?
That would be very lightweight.
|
@luke- fixed |
#277