1

Whilst browsing the FPC code in Enterprise_PageCache_Model_Processor, I cam e across this method:

/**
     * Check if processor is allowed for current HTTP request.
     * Disable processing HTTPS requests and requests with "NO_CACHE" cookie
     *
     * @return bool
     */
    public function isAllowed()
    {
        if (!$this->_requestId) {
            return false;
        }
        if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
            return false;
        }
        if (isset($_COOKIE['NO_CACHE'])) {
            return false;
        }
        if (isset($_GET['no_cache'])) {
            return false;
        }
        if (!Mage::app()->useCache('full_page')) {
            return false;
        }

        return true;
    }

Thus, if I am reading this right, FPC is disabled when in HTTPS? If a site is only run in HTTPS, is FPC thus pointless/no effect?

I have a site that is only in HTTPS, and FPC writes files to the folder, so what gives? Am I misunderstanding this code?

Anyone shed some light?

3
  • If magento is running under https, but the https is removed by load balancer, this function might return true :-) just an idea Dec 27, 2013 at 18:53
  • ah, good point. I use pound for ssl termination, so yes that makes sense. if you place as an answer I will credit.
    – ProxiBlue
    Dec 28, 2013 at 1:09
  • Does anyone know the reason why Magento is doing that?
    – Tobias
    Jan 26, 2015 at 14:00

1 Answer 1

2

I think you are correct with your interpretation, If the request ends as https at magento, FPC will do nothing.

But if you end https before, e.g. In the load balancer, the request will hit magento as http, therefore FPC will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.