Magento 2 – Varnish Cache-Control: Max_Age 0 Issue

cachemagento2varnish

So I have installed xVarnish or, CacheWall, but the Cache-control max_age is set to 0. I found this post here but I am not sure of the exact location that I can implement the answers suggestion of

"You are just missing session_cache_limiter and session_cache_expire, which should be the first lines executed on the requested PHP script, even before session_start()."

The same person edited their answer to also give the added option of modifying Apache mod_expires which I tried to do with this tutorial here which threw an error of wrong syntax when I tried to restart my apache2 server.

Is there a tutorial some one could point me too? or some direction on modifying the session_start in magento?

Sorry if this has been asked before and for my noobness. The url I am trying this on is www.brotomic.com the headers contain

 [root@host ~]# curl -I http://www.brotomic.com
HTTP/1.1 302 Found
Date: Thu, 17 Aug 2017 18:14:15 GMT
Pragma: no-cache
Cache-Control: max-age=0, must-revalidate, no-cache, no-store
Expires: Wed, 17 Aug 2016 18:14:15 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: PHPSESSID=o3h5m3r4ei5o3628ij49940u62; expires=Thu, 17-Aug-2017 19:14:15 GMT; Max-Age=3600; path=/; domain=www.brotomic.com; HttpOnly
Location: http://brotomic.com/?SID=o3h5m3r4ei5o3628ij49940u62
X-UA-Compatible: IE=edge
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Varnish: 229728
Age: 0
X-Cache: MISS
Connection: keep-alive

We are running on a dedicated server and also with centOS/cpanel.
Also would a VCL file change be appropriate for this?

Thanks.

Best Answer

I was able to find the session_cache_limiter and session_cache_expire through the WHM dashboard in MultiPHP INI Editor which allowed me to change the settings of these 2 features which changed my header and allowed Varnish to be be enabled.

Related Topic