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

Plugin not working with enabled cache #12

Closed
ghost opened this issue Dec 16, 2016 · 8 comments
Closed

Plugin not working with enabled cache #12

ghost opened this issue Dec 16, 2016 · 8 comments
Assignees

Comments

@ghost
Copy link

ghost commented Dec 16, 2016

Hi, I'm currently struggling with the setup on my Uberspace instance. The plugin fails without a error code. On my local XAMPP instance, everything works fine. I've tried setting the permissions to 755, at least in some cases the comments folder is created fine.

Do you have an idea what could be wrong?

@florianpircher
Copy link
Member

The demo at https://kirby-comments.addpixel.net/demos/comments is running on a Uberspace, too. Kirby Comments does return a status when processing the HTTP-data and the file-system, but it only shows errors generated by users (in snippets/comments.php at line 36 and 38). Please insert the following line after the second line in snippets/comments.php. (Just for debugging)

<?php echo $status->getCode() ?>

This outputs the status code in all cases. Please post that status code so I know where in the the system the error occurs.

@ghost
Copy link
Author

ghost commented Dec 17, 2016

Don't be surprised, the status code is 0. And commenting still doesn't work as expected, you can try it yourself. And if needed, the source code of my website is on GitHub.

@florianpircher
Copy link
Member

Hm, interesting… Your source-code seems to be OK. It works on your local machine using XAMPP, so I suspect it has something to do with your server setup.

@lukasleitsch
Copy link

@jlnostr You have the cache enabled. Did you tried to disable the cache for the article? If the cache enabled the post request is not working.

In the next version of Kirby the cache will be not use for post requests. getkirby/kirby#559

@florianpircher
Copy link
Member

Interesting note! Kirby Comments does not work with cache enabled, so this could be the problem. Kirby not enabling the cache for POST requests is great news. Unfortunately Kirby Comments also requires no cache on the first (non POST) visit in order to generate a random token for blocking Cross-site request forgery.

Currently this random token is required for comment preview and submission. I have to look into the security implications of making this token optional for the preview, thus allowing a cached version of the form to request a preview.

@ghost
Copy link
Author

ghost commented Jun 19, 2017

@lukasleitsch Never tried it. In the end, I've built my own solution based on @schmidtflo's blog posts. Nevertheless, it's nice to see this improved in the future 👍

@ghost ghost changed the title Setup on an Uberspace Plugin not working with enabled cache Jun 19, 2017
@florianpircher florianpircher self-assigned this Jun 19, 2017
@florianpircher
Copy link
Member

Kirby Comments now plays nicely with the new caching behavior in Kirby v2.5. Therefore, Kirby Comments is now usable on a site with enabled caching. A working version is already on the develop branch. In the following days I am going to move it to master and publish a new release.

@florianpircher
Copy link
Member

This has been fixed in 1.4.1.

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

No branches or pull requests

2 participants