I have magento2 with varnish 6 setup on docker with SSL termination on CloudFlare which have cahce on its own.
I want to know proper configuration of settings for:
1. Varnish – should I enable static and media caching?
if (req.url ~ "^/(pub/)?(media|static)/") {
# Static files should not be cached by default
# return (pass);
# But if you use a few locales and don't use CDN you can enable caching static files by commenting previous line (#return (pass);) and uncommenting next 3 lines
unset req.http.Https;
unset req.http.X-Forwarded-Proto;
unset req.http.Cookie;
}
2. Magento – should I add cdn url for static view or media files?