Stash::_is_cacheable PHP Méthode

_is_cacheable() private méthode

Check to see if a template (not a fragment) is suitable for caching
private _is_cacheable ( boolean $check_request_type = TRUE ) : string
$check_request_type boolean
Résultat string
    private function _is_cacheable($check_request_type = TRUE)
    {
        // Check if we should cache this URI
        if ($check_request_type) {
            if ($_SERVER['REQUEST_METHOD'] == 'POST' || $this->EE->input->get('ACT') || $this->EE->input->get('css') || $this->EE->input->get('URL')) {
                return FALSE;
            }
        }
        // has caching been deliberately disabled?
        if (FALSE === (bool) preg_match('/1|on|yes|y/i', $this->EE->TMPL->fetch_param('save', 'yes'))) {
            return FALSE;
        }
        // logged_in_only: only cache if the page visitor is logged in
        if ((bool) preg_match('/1|on|yes|y/i', $this->EE->TMPL->fetch_param('logged_in_only'))) {
            if ($this->EE->session->userdata['member_id'] == 0) {
                return FALSE;
                // don't cache
            }
        }
        // logged_out_only: only cache if the page visitor is logged out
        if ((bool) preg_match('/1|on|yes|y/i', $this->EE->TMPL->fetch_param('logged_out_only'))) {
            if ($this->EE->session->userdata['member_id'] != 0) {
                return FALSE;
                // don't cache
            }
        }
        return TRUE;
    }