The document discusses Symfony2, an open-source PHP web application framework. It describes Symfony2 as a set of decoupled components that form a full-stack framework. It also discusses key Symfony2 concepts like bundles, the service container, and the anatomy of a request from the reverse proxy to controller response. The document promotes Symfony2's support for caching dynamic content through edge side includes and client side includes.
5. What is Symfony2?
● Set of stand-alone, decoupled components
● Full-stack framework based on these
components
@zenstruck
6. What is Symfony2?
● Set of stand-alone, decoupled components
● Full-stack framework based on these
components
● Community
● Forum/Mailing List/IRC (#symfony on Freenode)
● 3rd party bundles (knpbundles.com)
● 5000+ watchers / 1300+ forks
● 560+ unique contributors
@zenstruck
7. Symfony2 Components
DependencyInjection
EventDispatcher
HttpFoundation
DomCrawler
ClassLoader
CssSelector
HttpKernel
BrowserKit
Templating
Translation
Serializer
Validator
Security
Routing
Console
Process
Config
Finder
Locale
Yaml
Form
@zenstruck
9. Why use Symfony2?
● Fast
● PHP 5.3
● Well engineered (no singletons)
● Forces* best practices
● Extensible and flexible
● Stable and established
● Testable
@zenstruck
14. HTTP Framework
Request Response
I don't like MVC because that's not how the web works. Symfony2
is an HTTP framework; it is a Request/Response framework.
That's the big deal. The fundamental principles of Symfony2 are
centered around the HTTP specification. - Fabien Potencier
@zenstruck
15. Bundles
● Everything is a bundle (even the framework is a collection of core
bundles)
● Bundles contain:
● Configuration/Translations/Documentation
● Routes/Controllers/Views
● Public resources (js/css/images)
● Services/Events/Models/Forms etc (* don't make your bundle a library)
● Tests
● NOT VENDOR LIBS
● Override with child bundle
● 690+ bundles on knpbundles.com
@zenstruck
28. 3 Types of HTTP Cache
● From the docs:
● Browser caches: Every browser comes with its own local cache that
is mainly useful for when you hit "back" or for images and other
assets. The browser cache is a private cache as cached resources
aren't shared with anyone else.
● Proxy caches: A proxy is a shared cache as many people can be
behind a single one. It's usually installed by large corporations and
ISPs to reduce latency and network traffic.
● Gateway caches: Like a proxy, it's also a shared cache but on the
server side. Installed by network administrators, it makes websites
more scalable, reliable and performant.
@zenstruck
35. Caching Dynamic Content
● Sub-requests
● ESI – Edge Side Includes
– Server side sub-requests
@zenstruck
36. Caching Dynamic Content
● Sub-requests
● ESI – Edge Side Includes
– Server side sub-requests
● CSI – Client Side Includes (new in 2.1)
– Uses javascript (hinclude.js)
– Client side sub-requests
@zenstruck