Skip to content

Varnish cache not working #4966

@jsakars

Description

@jsakars

Steps to reproduce

  1. Install Magento 2.0.7 on Centos with Nginx, PHP 7.07 FPM and MariaDB 10.1
  2. set $MAGE_MODE production; is set in Nginx server block
  3. Some content is added
  4. Varnish 4.03 is installed and configured. Note that Varnish was installed after Magento2 installation. All of that is currently running on the same server.
  5. Magento is configured to use Varnish Caching
  6. varnish.vcl generated by "Export VCL for Varnish 4" is being used
  7. We have around 46k products imported - none of them are enabled yet however

Expected result

  1. Pages are cached with ~100ms response time

Actual result

  1. Pages are not cached - it actually takes ~3 seconds to load
  2. Static files (CSS/JS) are cached
  3. Sysadmin is saying that PHP (Magento) is sending "no cache" header and therefore Varnish ignores the request.
  4. Following response headers are present:
Via:1.1 varnish-v4
X-Content-Type-Options:nosniff
X-Frame-Options:SAMEORIGIN
X-Magento-Cache-Debug:MISS
X-Powered-By:PHP/7.0.7
X-Varnish:262271
X-XSS-Protection:1; mode=block

What could be the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.2.xThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions