0

On CentOS7 and Cpanel with Mangeto 2.0.9 running on Apache I have installed and configured Varnish by moving Apache to 8080 port and SSL to 8888 (to disable). Then installed Nginx to listen on port 443 and redirect all to Varnish.

And it all works perfectly and Magento keeps everything https and the certificate is valid.

PROBLEM: var/cache and var/page_cache are always re-generated. Homepage always gives cache MISS and load time of 1.5 seconds.

Of course I have imported the Varnish 4 configuration from Magento Full page cache settings and changed it to work for Varnish, but var/ directory is still in use.

I have checked maybe every single article and guide and the most you can hear about var/page_cache is that if its not re-created then you're done, but what if it still is? Where to look?

I checked all Magento's var/log/(system|debug|exception).log's and nothing about there.

Any suggestion is welcomed! Thanks!

EDIT: This is env.php bottom part:

  'x-frame-options' => 'SAMEORIGIN',
  'MAGE_MODE' => 'developer',
  'cache_types' => 
  array (
    'config' => 1,
    'layout' => 1,
    'block_html' => 1,
    'collections' => 1,
    'reflection' => 1,
    'db_ddl' => 1,
    'eav' => 1,
    'config_integration' => 1,
    'config_integration_api' => 1,
    'full_page' => 1,
    'translate' => 1,
    'config_webservice' => 1,
    'compiled_config' => 1,
  ),

EDIT: After changed to production mode via editing env.php and made

rm -rf var/*cache

the only thing changed is that response header

X-Magento-Cache-Debug: MISS

disappeared from the homepage request.

  • Magento run mode? developer / default / production? Have reloaded Varnish after adding generated .vcl? – Danila Vershinin Oct 19 '16 at 23:21
  • Of course I reloaded! I reloaded all 3: varnish, httpd and ngninx. Magento is in developer mode according to env.php. I will post not its config related to cache and mode. – user109764 Oct 19 '16 at 23:30
0
  • Add at the end of your env.php file

    'http_cache_hosts' => 
    
      array (
    
        0 => 
    
        array (
    
          'host' => '127.0.0.1',
          'port' => '80',
    
        ),
    
      ),
    
  • Replace host IP with your server IP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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