Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

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

Closed
mynameisfreedom opened this issue Nov 7, 2022 · 4 comments
Closed

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

mynameisfreedom opened this issue Nov 7, 2022 · 4 comments

Comments

@mynameisfreedom
Copy link

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

@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
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants