Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation about automatic behavior of SYMFONY_HTTP_CACHE #395

Open
wants to merge 1 commit into
base: 2.5
Choose a base branch
from

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
@@ -56,8 +56,7 @@
# Optional: Whether to use Symfony's builtin HTTP Caching Proxy.
# Disable it if you are using an external reverse proxy (e.g. Varnish)
# 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