|
| 1 | +<?php |
| 2 | + |
| 3 | +$container->loadFromExtension('fos_http_cache', array( |
| 4 | + 'cache_control' => array( |
| 5 | + 'rules' => array( |
| 6 | + array( |
| 7 | + 'match' => array( |
| 8 | + 'path' => '/abc', |
| 9 | + 'host' => 'fos', |
| 10 | + 'methods' => array('GET', 'POST'), |
| 11 | + 'ips' => '1.2.3.4, 1.1.1.1', |
| 12 | + 'attributes' => array('_controller' => 'fos.user_bundle.*'), |
| 13 | + 'additional_cacheable_status' => array(100, 500), |
| 14 | + ), |
| 15 | + 'headers' => array( |
| 16 | + 'cache_control' => array( |
| 17 | + 'public' => true, |
| 18 | + ), |
| 19 | + 'last_modified' => '-1 hour', |
| 20 | + 'reverse_proxy_ttl' => 42, |
| 21 | + 'vary' => 'Cookie', |
| 22 | + ), |
| 23 | + ), |
| 24 | + ), |
| 25 | + ), |
| 26 | + 'proxy_client' => array( |
| 27 | + 'varnish' => array( |
| 28 | + 'servers' => array('22.22.22.22'), |
| 29 | + 'base_url' => '/test', |
| 30 | + ), |
| 31 | + ), |
| 32 | + |
| 33 | + 'cache_manager' => array( |
| 34 | + 'enabled' => true, |
| 35 | + ), |
| 36 | + 'tags' => array( |
| 37 | + 'rules' => array( |
| 38 | + array( |
| 39 | + 'match' => array( |
| 40 | + 'path' => '/def', |
| 41 | + 'host' => 'friends', |
| 42 | + 'methods' => array('PUT', 'DELETE'), |
| 43 | + 'ips' => '99.99.99.99', |
| 44 | + 'attributes' => array( |
| 45 | + '_foo' => 'bar', |
| 46 | + ), |
| 47 | + 'additional_cacheable_status' => array(501, 502), |
| 48 | + ), |
| 49 | + 'tags' => array('a', 'b'), |
| 50 | + 'tag_expressions' => array('"a"', '"b"'), |
| 51 | + ), |
| 52 | + ), |
| 53 | + ), |
| 54 | + 'invalidation' => array( |
| 55 | + 'enabled' => 'auto', |
| 56 | + 'rules' => array( |
| 57 | + array( |
| 58 | + 'match' => array( |
| 59 | + 'path' => '/hij', |
| 60 | + 'host' => 'symfony', |
| 61 | + 'methods' => array('PATCH'), |
| 62 | + 'ips' => array('42.42.42.42'), |
| 63 | + 'attributes' => array( |
| 64 | + '_format' => 'json', |
| 65 | + ), |
| 66 | + 'additional_cacheable_status' => array(404, 403), |
| 67 | + ), |
| 68 | + 'routes' => array( |
| 69 | + 'invalidate_route1' => array( |
| 70 | + 'ignore_extra_params' => false, |
| 71 | + ), |
| 72 | + ), |
| 73 | + ), |
| 74 | + ), |
| 75 | + ), |
| 76 | + 'user_context' => array( |
| 77 | + 'enabled' => true, |
| 78 | + 'match' => array( |
| 79 | + 'matcher_service' => 'fos_http_cache.user_context.request_matcher', |
| 80 | + 'accept' => 'application/vnd.fos.user-context-hash', |
| 81 | + 'method' => 'GET', |
| 82 | + ), |
| 83 | + 'hash_cache_ttl' => 300, |
| 84 | + 'user_identifier_headers' => array('Cookie', 'Authorization'), |
| 85 | + 'user_hash_header' => 'FOS-User-Context-Hash', |
| 86 | + 'role_provider' => true, |
| 87 | + ), |
| 88 | + 'flash_message_listener' => array( |
| 89 | + 'enabled' => true, |
| 90 | + 'name' => 'flashtest', |
| 91 | + 'path' => '/x', |
| 92 | + 'host' => 'y', |
| 93 | + 'secure' => true, |
| 94 | + 'httpOnly' => false, |
| 95 | + ), |
| 96 | + 'debug' => array( |
| 97 | + 'header' => 'FOS-Cache-Debug', |
| 98 | + ), |
| 99 | + |
| 100 | +)); |
0 commit comments