Skip to content

Conversation

@peterkeung
Copy link

@peterkeung peterkeung commented Apr 17, 2019

I can see no code that conditionally sets SYMFONY_HTTP_CACHE based on SYMFONY_TRUSTED_PROXIES

Also the extra phrase about it being empty makes it more confusing than needed. The phrase about the default behavior is good enough.

@peterkeung peterkeung force-pushed the symfony_http_cache_documentation branch from 695a668 to 162e561 Compare April 18, 2019 00:04
@benkmugo
Copy link

+1
I think the SYMFONY_HTTP_CACHE default behaviour line could be made clearer though

e.g.
if empty + prod = enabled
if not set + prod = enabled
if set explictly 0|1 = disabled|enabled regardless of env

@andrerom andrerom changed the base branch from master to 2.5 September 30, 2019 11:52
# Possible values: 0, 1 or ""
# Defaults to disabled if SYMFONY_ENV is set to "dev" or SYMFONY_TRUSTED_PROXIES is set,
# and if this env value is omitted or empty
# Defaults to disabled if SYMFONY_ENV is set to "dev"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the doc here was trying to explain this in app.php:

// Depending on the SYMFONY_HTTP_CACHE environment variable, tells whether the internal HTTP Cache mechanism is to be used.
// Recommendation is to use Varnish over this, for performance and being able to setup cluster if you need to.
// If not set, or "", it is auto activated if _not_ in "dev" environment.
if (($useHttpCache = getenv('SYMFONY_HTTP_CACHE')) === false || $useHttpCache === '') {
    $useHttpCache = $environment !== 'dev';
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In reviewing what you just pasted, I think the suggested doc edit makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants