-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache Duration in Cake 2.x #7
Comments
Using a configuration key is actually more in line with the newer Cake 3 strategy of |
Yep, Chris beat me to it. I'm working on a commit that demonstrates the modifications to make for Cake 2 to handle this. I'll post when I've pushed it. |
Okay, so this is indeed another excellent point, and is indeed another example where we need to make Cake 2 more like Cake 3 by moving configs into The basic idea is instead of calling I just pushed a commit for the sample Cake 2 app that demonstrates one possible solution: 8367acd The core of that change is right here. This is a little clunkier than how I handle the Database and Email configs (which have their own classes in which to do the necessary dirty work) but it gets the job done with minimal duplication. |
Addresses the question raised in #7.
Hi Brian,
I just noticed a bug in your 2.x core.php. It jumped out at me because I had the same bug in my production app until a few months ago!
Line 25:
Configure::write("debug", 0);
Line 334:
Environment overrides are not called until later in the file. Therefore, when the value of debug is checked, it is always zero. As a result, dev environments will have long caches.
I am working on implementing your system into our app at the moment and my solution to this is simply to define Cache.Duration as a configuration key in core-{$env} and move the app override code further up core.php.
The text was updated successfully, but these errors were encountered: