Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
6dcb2587
Commit
6dcb2587
authored
Jan 19, 2012
by
Thibaut Cuvelier
Committed by
Fabien Potencier
May 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed typos (closes #240)
parent
4ca0e586
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
doc/providers/http_cache.rst
doc/providers/http_cache.rst
+15
-3
No files found.
doc/providers/http_cache.rst
View file @
6dcb2587
...
@@ -16,7 +16,7 @@ Services
...
@@ -16,7 +16,7 @@ Services
--------
--------
* **http_cache**: An instance of `HttpCache
* **http_cache**: An instance of `HttpCache
<http:
//
api
.
symfony
.
com
/
master
/
Symfony
/
Component
/
HttpKernel
/
HttpCache
/
HttpCache
.
html
>
`_
,
<http:
//
api
.
symfony
.
com
/
master
/
Symfony
/
Component
/
HttpKernel
/
HttpCache
/
HttpCache
.
html
>
`_
.
Registering
Registering
-----------
-----------
...
@@ -30,21 +30,33 @@ Registering
...
@@ -30,21 +30,33 @@ Registering
Usage
Usage
-----
-----
Silex already supports any
Reverse P
roxy like Varnish out of the box by
Silex already supports any
reverse p
roxy like Varnish out of the box by
setting Response HTTP cache headers::
setting Response HTTP cache headers::
use Symfony\Component\HttpFoundation\Response;
$app->get('/', function() {
$app->get('/', function() {
return new Response('Foo', 200, array(
return new Response('Foo', 200, array(
'Cache-Control' => 's-maxage=5',
'Cache-Control' => 's-maxage=5',
));
));
});
});
.. tip::
If you want Silex to trust the `X-Forwarded-For*` headers from your
reverse proxy, you will need to run your application like this::
use Symfony\Component\HttpFoundation\Request;
Request::trustProxyData();
$app->run();
This provider allows you to use the Symfony2 reverse proxy natively with
This provider allows you to use the Symfony2 reverse proxy natively with
Silex applications by using the `http_cache` service::
Silex applications by using the `http_cache` service::
$app['http_cache']->run();
$app['http_cache']->run();
The provider also provide ESI support::
The provider also provide
s
ESI support::
$app->get('/', function() {
$app->get('/', function() {
return new Response(
<
<<
EOF
return new Response(
<
<<
EOF
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment