This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/HttpFoundation
Fabien Potencier b6923dd7b9 changed Cache-Control default value behavior
The PHP native cache limiter feature has been disabled as this is now managed
by the HeaderBag class directly instead (see below.)

The HeaderBag class uses the following rules to define a sensible and
convervative default value for the Response 'Cache-Control' header:

 * If no cache header is defined ('Cache-Control', 'ETag', 'Last-Modified',
   and 'Expires'), 'Cache-Control' is set to 'no-cache';

 * If 'Cache-Control' is empty, its value is set to "private, max-age=0,
   must-revalidate";

 * But if at least one 'Cache-Control' directive is set, and no 'public' or
   'private' directives have been explicitely added, Symfony2 adds the
   'private' directive automatically (except when 's-maxage' is set.)

So, remember to explicitly add the 'public' directive to 'Cache-Control' when
you want shared caches to store your application resources:

    // The Response is private by default
    $response->setEtag($etag);
    $response->setLastModified($date);
    $response->setMaxAge(10);

    // Change the Response to be public
    $response->setPublic();

    // Set cache settings in one call
    $response->setCache(array(
        'etag'          => $etag,
        'last_modified' => $date,
        'max_age'       => 10,
        'public'        => true,
    ));
2010-11-18 17:05:05 +01:00
..
File [HttpFoundation] Fixed tests for windows 2010-11-18 06:59:12 +01:00
Fixtures Fix UniversalClassLoader issues with leading slashes. 2010-10-20 14:20:12 +02:00
HeaderBagTest.php changed Cache-Control default value behavior 2010-11-18 17:05:05 +01:00
ParameterBagTest.php renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00
RequestMatcherTest.php [HttpFoundation] changed RequestMatcher pattern syntax 2010-10-07 19:12:53 +02:00
RequestTest.php [HttpFoundation] removed port number from HOST header 2010-10-28 15:14:48 +02:00
ResponseHeaderBagTest.php changed Cache-Control default value behavior 2010-11-18 17:05:05 +01:00
ResponseTest.php changed Cache-Control default value behavior 2010-11-18 17:05:05 +01:00
UniversalClassLoaderTest.php Fix UniversalClassLoader issues with leading slashes. 2010-10-20 14:20:12 +02:00