test¶
Configures a proxy server and test client that can be used when testing your application against a caching proxy.
// app/config/config_test.yml
fos_http_cache:
test:
proxy_server:
varnish:
config_file: /etc/varnish/your-config.vcl
port: 8080
binary: /usr/sbin/varnish
client:
varnish:
enabled: true
nginx:
enabled: false
proxy_server¶
Configures a service that can be used to start, stop and clear your caching proxy from PHP. This service is meant to be used in integration tests; don’t use it in production mode.
varnish¶
config_file¶
type: string required
Path to a VCL file. For example Varnish configurations, see Caching Proxy Configuration.
binary¶
type: string default: varnishd
Path to the proxy binary (if the binary is named differently or not available in your PATH).
nginx¶
config_file¶
type: string required
Path to an Nginx configuration file. For an example Nginx configuration, see Caching Proxy Configuration.
client¶
Configures the proxy test client for Varnish and/or Nginx.
type: array
enabled¶
type: enum default: auto options: true, false, auto
The default value is %kernel.debug%, enabling the client when you are in test or dev mode but not in prod mode.
cache_header¶
type: string default: X-Cache
HTTP header that shows whether the response was a cache hit (HIT) or a miss (MISS). This header must be set by your caching proxy for the test assertions to work.