sebastiangreger / kirby3-commentions

A versatile comment system and integrated Webmention endpoint for Kirby 3.
MIT License
58 stars 7 forks source link

If Kirby cache is on comments don't work #147

Closed mynameisfreedom closed 1 year ago

mynameisfreedom commented 2 years ago

Hi, @sebastiangreger !

I am experiencing an issue with the Kirby cache. When Kirby's cache is on the comments don't work. It just refreshes the page.

The current versions on specific website are Kirby 3.6.6 and Commentions 1.0.5

Yes, I will soon update to newer versions, but this is worth checking.

mynameisfreedom commented 2 years ago

As a solution, at the moment I am using exclude from cache for specific templates where commenting is used

/* https://getkirby.com/docs/reference/system/options/cache */
    'cache' => [
        'pages' => [
          'active' => true,
          'ignore' => function($page) {
            if ($page->intendedTemplate()->name() === 'article') {
              return true;
                }
            }
        ]
    ],
sebastiangreger commented 2 years ago

Hi @mynameisfreedom – thanks for getting in touch! The submission of a comment takes place using a POST request, which should not serve a cached page from Kirby's page cache. From your description, the display of the "refreshed" page could indicate that the spam trap got triggered (which is not announced in the frontend as to not give a hint to a potential spammer; an approach that, as discussed in #95, has pros and cons) – specifically the timemin and timemax trap that use a timestamp to measure the time expired between loading the page and submitting the content (dismissing comments that are submitted unhumanly fast or on a very old version of the comment form).

Commentions should automatically deactivate those spam traps when caching is active (happening here), but maybe that fails for some reason? If my theory is correct, using 'sgkirby.commentions.spamprotection' => ['honeypot'], hence disabling the timemin and timemax traps, in your config should eliminate this issue (see https://github.com/sebastiangreger/kirby3-commentions#spam-protection for details).

sebastiangreger commented 1 year ago

@mynameisfreedom I hope you don't mind me pinging you here in a slightly off-topic manner, but I'd like to draw your attention to my update that I am no longer able to maintain the Commentions plugin in the future → details here.

mynameisfreedom commented 1 year ago

Hi @sebastiangreger, I am very sorry to hear that, you've done a fantastic job with Commentions plugin. But I know it is hard to maintain it, and do a regular job. Time is something we all have to value dearly. That's why I am a believer in premium plugins and themes. Commentions plugin should always be a premium plugin. Although, I don't know your situation, and would that change anything...

Anyway, I am sorry to hear this and will try to give my contribution in helping maintain the plugin or find someone who will.