tractorcow / silverstripe-dynamiccache

Simple on the fly caching of dynamic content for Silverstripe
39 stars 27 forks source link

BUG Form submission doesn't work properly #1

Closed tractorcow closed 11 years ago

tractorcow commented 11 years ago

Cache seems to hit when a page with errors is being displayed. There needs to be additional checks to bypass caching during form processing.

dospuntocero commented 11 years ago

can form pages being un cached? or maybe partial cache will work better here?

tractorcow commented 11 years ago

The solution I have in place is to cache the form pages, but of course bypass cache for post requests. The main problem I had was with the subsequent redirect for any pages with errors, as it's a normal GET request.

The solution I'm trialing is checking the session to see if there are any form errors wishing to be displayed.

https://github.com/tractorcow/silverstripe-dynamiccache/commit/5c95c92afe5c6ccb81b9f886837ae65b7977b3e8

Another problem I need to solve is CSRF. :)

tractorcow commented 11 years ago

I've added a new update which, for reasons I cannot understand, fixes this issue. It seems there was some issue around handling of Sessions in some deployment environments.

I still have yet to fix the CSRF issue, but I'll make that another ticket.