tractorcow / silverstripe-dynamiccache

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

Fixes #30

Closed jonom closed 8 years ago

jonom commented 8 years ago

Work in progress

The reason this is a WIP is that it uses http_response_code() function which is only available from PHP 5.4 onwards. Assuming you are happy with these changes, would you prefer this went in to:

a) 3.1 branch, with composer.json and README.md requirements updated with PHP 5.4 requirement b) A new major version due to PHP 5.4 requirement

?

jonom commented 8 years ago

p.s. Sorry no tests, I wasn't sure where to start with that :smile:

tractorcow commented 8 years ago

It's not like we have any tests otherwise. :)

tractorcow commented 8 years ago

Fixed /home/ not redirecting to root. This happened because 'home' was being used as the URL component of the cache key for root, which tricked system in to thinking /home/' was a valid URL.

Makes sense now. I agree with your diagnosis. :)

tractorcow commented 8 years ago

And look, our very first stable release.

https://github.com/tractorcow/silverstripe-dynamiccache/releases/tag/3.1.0

jonom commented 8 years ago

Thanks for the merge :D did you catch the part about PHP 5.4 requirement though? Think the composer.json and README.md should be updated to reflect that.

tractorcow commented 8 years ago

I'll re-branch this. :D

tractorcow commented 8 years ago

Master is now aliased as 4.x, and I've reset the 3.1 branch to just before this change.

https://github.com/tractorcow/silverstripe-dynamiccache/commit/6e19546bc5cd3179307d7c3b7f676670b822a1fe

jonom commented 8 years ago

Nice :+1: loving this module Damian, think I will be using it in all my projects going forward. Works well paired with partial caching for a substantial performance improvement and a lot easier to set up and manage than other static caching solutions I've tried.

tractorcow commented 8 years ago

@jonom just make sure you don't mix it with other caching mechanisms; It's really only intended for environments where reverse proxies or WAF level caching isn't available (and each is probably superior to this solution).

jonom commented 8 years ago

Well since I had to google 'reverse proxy' and 'WAF' just now I don't think that will be a problem for me :smile:

tractorcow commented 8 years ago

WAF = "The but that your visitors talk to, that isn't actually you, but will ask you for content when it needs it"

reverse proxy = "Like a WAF but not so far away"