Welcome Guest, Not a member yet? Register   Sign In
Disable / enable cache per environment
#1

Hi,

is it possible to enable / disable the cache for development end production? I want to disable the cache in dev and enable in production
Reply
#2

What cache?
Reply
#3

I mean the page cache
Reply
#4

@groovebird you mean at writable/cache ?
CMS CI4     I use Arch Linux by the way 

Reply
#5

(This post was last modified: 10-13-2022, 12:00 PM by groovebird.)

(10-13-2022, 10:56 AM)captain-sensible Wrote: @groovebird you mean at writable/cache ?

My driver is a filecache, then yes writable/cache if the page cache is stored there. In development i don't want to clear the cache after changes
Reply
#6

Something like this?

PHP Code:
        if (ENVIRONMENT === 'production') {
            $this->cachePage($n);
        
Reply
#7

(10-13-2022, 04:26 PM)kenjis Wrote: Something like this?

PHP Code:
        if (ENVIRONMENT === 'production') {
            $this->cachePage($n);
        

Exactly what i did. I assumed there is a setting, because the condition i have to write in every controller. I think i will add a new function with the condition inside
Reply




Theme © iAndrew 2016 - Forum software by © MyBB