enabling cache in database.php, a question |
I'm brand new to CI 4 and just installed it. I setup database.php to match my settings and I enabled cache (cahceON=true) and set the cache folder to simply "cache" and created that folder under public. Is this correct? And does this setting cache the site, or just the DB?
Any tips would be most appreciated! ![]()
No, you need an absolute path. And don't store it in the public folder, you should store it in your writable folder for an example.
https://codeigniter.com/user_guide/datab...-of-values It's only caching database objects. Complete website: https://codeigniter.com/user_guide/general/caching.html Caching objects: https://codeigniter.com/user_guide/libra...ching.html The best tip I can give you are reading the User Guide from top to bottom, and then start coding so you have a grasp on where to look. (08-16-2020, 12:33 AM)jreklund Wrote: No, you need an absolute path. And don't store it in the public folder, you should store it in your writable folder for an example. Great, thanks so much!! ![]() (08-16-2020, 12:33 AM)jreklund Wrote: No, you need an absolute path. And don't store it in the public folder, you should store it in your writable folder for an example. Okay, I did this in app/Config/Cache.php: Code: /var/www/vhosts/schismdream.com/writable/cache/ and set the cache method to "files". Then Code: $this->cachePage(30); in the Home.php controller for testing purposes. It doesn't work and I get the "whoops" error page. ![]() All folders under Writeable are chmodded 777. Thanks!
I'm sorry to be the bearer of bad news but database caching is not supported for CI4. This has been removed in latest develop.
Issue: https://github.com/codeigniter4/CodeIgni...ssues/3597 PR: https://github.com/codeigniter4/CodeIgniter4/pull/3608 You have to use the generic caching used by the Cache library. But expect to not have caching specific to databases. (10-26-2020, 09:17 AM)paulbalandan Wrote: I'm sorry to be the bearer of bad news but database caching is not supported for CI4. This has been removed in latest develop. I mainly just want "regular" caching, not DB caching, if there is a difference. ![]()
|
Welcome Guest, Not a member yet? Register Sign In |