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

Use FOSHttpCacheBundle #103

Merged
merged 2 commits into from Oct 24, 2014
Jump to file or symbol
Failed to load files and symbols.
+136 −14
Diff settings

Always

Just for now

View
@@ -15,6 +15,7 @@ public function registerBundles()
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new FOS\HttpCacheBundle\FOSHttpCacheBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
@@ -40,7 +41,6 @@ public function registerBundles()
new Kunstmaan\NodeSearchBundle\KunstmaanNodeSearchBundle(),
new Kunstmaan\SitemapBundle\KunstmaanSitemapBundle(),
new Kunstmaan\ArticleBundle\KunstmaanArticleBundle(),
new Liip\CacheControlBundle\LiipCacheControlBundle(),
new Kunstmaan\TranslatorBundle\KunstmaanTranslatorBundle(),
new Ekino\Bundle\NewRelicBundle\EkinoNewRelicBundle(),
new Kunstmaan\RedirectBundle\KunstmaanRedirectBundle(),
View
@@ -28,9 +28,38 @@ monolog:
console:
type: console
liip_cache_control:
rules:
- { path: /admin, controls: { private: true, max_age: 0 } }
- { path: /preview, controls: { private: true, max_age: 0 } }
- { path: ^/_internal, controls: {private: true, max_age: 0 } }
- { path: ^/(.+), controls: { public: true, max_age: 360, s_maxage: 360 }, vary: [Cookie,Accept-Encoding] }
fos_http_cache:
cache_control:
rules:
# match admin area
-
match:
path: ^/[^/]+/admin
headers:
cache_control:
public: false
max_age: 0
s_maxage: 0
last_modified: "-1 hour"
# match esi requests
-
match:
path: ^/_fragment
headers:
cache_control:
public: false
max_age: 0
s_maxage: 0
last_modified: "-1 hour"
# match everything to set defaults
-
match:
path: ^/
headers:
cache_control:
public: true
max_age: 360
s_maxage: 360
vary: [Accept-Encoding, Accept-Language]
@@ -0,0 +1,53 @@
# KunstmaanMediaBundle
_imagine:
resource: .
type: imagine
KunstmaanMediaBundle:
resource: "@KunstmaanMediaBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanAdminBundle
KunstmaanAdminBundle:
resource: "@KunstmaanAdminBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanNodeBundle
KunstmaanNodeBundle:
resource: "@KunstmaanNodeBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanPagePartBundle
KunstmaanPagePartBundle:
resource: "@KunstmaanPagePartBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanFormBundle
KunstmaanFormBundle:
resource: "@KunstmaanFormBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanSitemapBundle
KunstmaanSitemapBundle:
resource: "@KunstmaanSitemapBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanTranslatorBundle
KunstmaanTranslatorBundle:
resource: "@KunstmaanTranslatorBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanRedirectBundle
KunstmaanRedirectBundle:
resource: "@KunstmaanRedirectBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanUserManagementBundle
KunstmaanUserManagementBundle:
resource: "@KunstmaanUserManagementBundle/Resources/config/routing.yml"
prefix: /
# KunstmaanDashboardBundle
KunstmaanDashboardBundle:
resource: "@KunstmaanDashboardBundle/Resources/config/routing.yml"
prefix: /
@@ -0,0 +1,44 @@
jms_security_extra:
secure_all_services: false
expressions: true
security:
acl:
connection: default
encoders:
"FOS\UserBundle\Model\UserInterface": sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
ROLE_NEWS: ROLE_USER
providers:
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
main:
pattern: .*
form_login:
login_path: fos_user_security_login
check_path: fos_user_security_check
provider: fos_userbundle
logout:
path: fos_user_security_logout
target: KunstmaanAdminBundle_homepage
anonymous: true
remember_me:
key: %secret%
lifetime: 604800
path: /
domain: ~
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
access_control:
- { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin, role: ROLE_ADMIN }
View
@@ -39,10 +39,6 @@ security:
security: false
access_control:
- { path: ^/([^/]*)/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/([^/]*)/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/([^/]*)/admin/settings/, role: ROLE_ADMIN }
- { path: ^/([^/]*)/admin/settings, role: ROLE_ADMIN }
- { path: ^/([^/]*)/admin/, role: ROLE_ADMIN }
- { path: ^/([^/]*)/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/([^/]*)/admin/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/([^/]*)/admin, role: ROLE_ADMIN }
- { path: ^/([^/]*)/preview, role: ROLE_ADMIN }
View
@@ -22,7 +22,7 @@
"kunstmaan/bundles-cms": "3.0.*@dev",
"raven/raven": "~0.8",
"liip/cache-control-bundle": "~1.0.7",
"friendsofsymfony/http-cache-bundle": "~1.0",
"ekino/newrelic-bundle": "~1.2.2",
"jms/security-extra-bundle": "~1.5.1",
"doctrine/doctrine-migrations-bundle": "2.1.*@dev",
ProTip! Use n and p to navigate between commits in a pull request.