Your Location is: Home > Timber

delete_cache function taking a very long time to execute

From: Swaziland View: 4921 johnmontfx 


I'm getting some very time consuming database calls while using Timber to generate a template, as part of the Timber\Loader::delete_cache function. I've attempted to turn off the CACHE on all my templates in the compile (see code below) and I don't see any "timberloader" caches in the wp_options database.

This routine is taking up 30% of the page php processing time (see the NewRelic php tracer, below) -- and since I'm using sub templates this function occurs twice and is taking up 60% of the total page php processing time.

Is this a bug or something I'm doing wrong?

Thanks for any possible insights.

enter image description here

return Timber::compile(
        'logoutlink'        => wp_logout_url( home_url() ),
        'cart'                  => $cart,
        'cartcount'         => $cartcount,
        'login'                 => $login,
        'admin'                 => $admin
    ),0, CACHE_NONE

Best answer