The document discusses developing cacheable PHP applications. It recommends designing software with HTTP caching in mind by making applications stateless, using well-defined time to lives for cache expiration, and conditionally caching content. It also discusses common problems like time to live variations and authentication that make caching challenging. The document provides examples of implementing caching using Symfony, Twig templates, and Edge Side Includes to break pages into cacheable components.
In this presentation, I show the audience how to implement HTTP caching best practices in a non-intrusive way in PHP Symfony 4 code base.
This presentation focuses on topics like:
- Caching using cache-control headers
- Cache variations using the Vary header
- Conditional requests using headers like ETag & If-None-Match
- ESI discovery & parsing using headers like Surrogate-Capability & Surrogate-Control
- Caching stateful content using JSON Web Token Validation in Varnish
More information about this presentation is available at https://feryn.eu/speaking/developing-cacheable-php-applications-php-limburg-be/
More information about this HTTP caching talk can be found on https://feryn.eu/speaking/leverage-http-to-deliver-cacheable-websites-codemotion-rome-2018/
Most of us are familiar with HTTP, but when it actually comes to creating cacheable web content, there is still a lot to be learned. In this presentation I will show you how to leverage specific mechanism to achieve a good hit rate without losing touch with some of the challenges of real-life web projects. Keywords: cache control, cache variations, conditional requests, stateful content, HTTP fragments, invalidation. The goals is to empower developers to control the behavior of reverse caching proxies like Varnish, Content Delivery Networks, or even browser cache, using the power of HTTP.
A talk about how HTTP caching features that can and should be used to reduce origin server loads and traffic whilst retaining very small cache expire times. More specifically will cover what basic http headers are used by standard cache devices and how they differ, as well as how can they be used in combination to achieve smart cache revalidation.
This document discusses techniques for building scalable websites with Perl, including:
1) Caching at various levels (page, partial page, and database caching) to improve performance and reduce load on application servers.
2) Using job queuing and worker processes to distribute processing-intensive tasks asynchronously instead of blocking web requests.
3) Leveraging caching and queueing libraries like Cache::FastMmap, Memcached, and Spread::Queue to implement caching and job queueing in Perl applications.
Site Performance - From Pinto to FerrariJoseph Scott
This document discusses ways to improve website performance from slow "Pinto" levels to faster "Ferrari" levels. It recommends using an opcode cache like APC to speed up PHP, optimizing databases with technologies like Memcached, using caching plugins in WordPress, and considering architectures with load balancing and replication. The goal is to identify bottlenecks and apply techniques that reduce page load times through an understanding of how websites and underlying technologies work.
Introduction to performance tuning perl web applicationsPerrin Harkins
This document provides an introduction to performance tuning Perl web applications. It discusses identifying performance bottlenecks, benchmarking tools like ab and httperf to measure performance, profiling tools like Devel::NYTProf to find where time is spent, common causes of slowness like inefficient database queries and lack of caching, and approaches for improvement like query optimization, caching, and infrastructure changes. The key messages are that performance issues are best identified through measurement and profiling, database queries are often the main culprit, and caching can help but adds complexity.
This document summarizes techniques for building scalable websites with Perl, including caching whole pages, chunks of HTML/data, and using job queuing. Caching helps performance by reducing workload and scalability by lowering database load. Large sites like Yahoo cache aggressively. Job queuing prevents overloading resources and keeps websites responsive under high demand by lining requests up in a queue.
In this presentation, I show the audience how to implement HTTP caching best practices in a non-intrusive way in PHP Symfony 4 code base.
This presentation focuses on topics like:
- Caching using cache-control headers
- Cache variations using the Vary header
- Conditional requests using headers like ETag & If-None-Match
- ESI discovery & parsing using headers like Surrogate-Capability & Surrogate-Control
- Caching stateful content using JSON Web Token Validation in Varnish
More information about this presentation is available at https://feryn.eu/speaking/developing-cacheable-php-applications-php-limburg-be/
More information about this HTTP caching talk can be found on https://feryn.eu/speaking/leverage-http-to-deliver-cacheable-websites-codemotion-rome-2018/
Most of us are familiar with HTTP, but when it actually comes to creating cacheable web content, there is still a lot to be learned. In this presentation I will show you how to leverage specific mechanism to achieve a good hit rate without losing touch with some of the challenges of real-life web projects. Keywords: cache control, cache variations, conditional requests, stateful content, HTTP fragments, invalidation. The goals is to empower developers to control the behavior of reverse caching proxies like Varnish, Content Delivery Networks, or even browser cache, using the power of HTTP.
A talk about how HTTP caching features that can and should be used to reduce origin server loads and traffic whilst retaining very small cache expire times. More specifically will cover what basic http headers are used by standard cache devices and how they differ, as well as how can they be used in combination to achieve smart cache revalidation.
This document discusses techniques for building scalable websites with Perl, including:
1) Caching at various levels (page, partial page, and database caching) to improve performance and reduce load on application servers.
2) Using job queuing and worker processes to distribute processing-intensive tasks asynchronously instead of blocking web requests.
3) Leveraging caching and queueing libraries like Cache::FastMmap, Memcached, and Spread::Queue to implement caching and job queueing in Perl applications.
Site Performance - From Pinto to FerrariJoseph Scott
This document discusses ways to improve website performance from slow "Pinto" levels to faster "Ferrari" levels. It recommends using an opcode cache like APC to speed up PHP, optimizing databases with technologies like Memcached, using caching plugins in WordPress, and considering architectures with load balancing and replication. The goal is to identify bottlenecks and apply techniques that reduce page load times through an understanding of how websites and underlying technologies work.
Introduction to performance tuning perl web applicationsPerrin Harkins
This document provides an introduction to performance tuning Perl web applications. It discusses identifying performance bottlenecks, benchmarking tools like ab and httperf to measure performance, profiling tools like Devel::NYTProf to find where time is spent, common causes of slowness like inefficient database queries and lack of caching, and approaches for improvement like query optimization, caching, and infrastructure changes. The key messages are that performance issues are best identified through measurement and profiling, database queries are often the main culprit, and caching can help but adds complexity.
This document summarizes techniques for building scalable websites with Perl, including caching whole pages, chunks of HTML/data, and using job queuing. Caching helps performance by reducing workload and scalability by lowering database load. Large sites like Yahoo cache aggressively. Job queuing prevents overloading resources and keeps websites responsive under high demand by lining requests up in a queue.
The document discusses configuring Nginx and PHP-FPM for high performance websites. Some key points:
- Nginx is a lightweight and fast HTTP server that is well-suited for high traffic loads. It can be used as a web server, reverse proxy, load balancer, and more.
- PHP-FPM (PHP FastCGI Process Manager) runs PHP processes as a pool that is separate from the web server for better isolation and performance. Nginx communicates with PHP-FPM via FastCGI.
- Benchmark results show Nginx performing better than Apache, especially under high concurrency loads. Caching with Nginx and Memcached can further improve
Google's Go is a relatively new systems programming language that has recently gained a lot of traction with developers. It brings together the ease and efficiency of development in modern interpreted languages like Python, Perl, and Ruby with the efficiency and safety of a statically typed, compiled language like C/C++ and Java.
On top of that, Go is a language built for modern hardware and problems. With built-in support for concurrency, programmers can easily build software to scale up to today's many-core beasts. Programming in Go is really nice, and in this tutorial, you will learn why.
We will cover an introduction to the Go programming language, and together we will build a multi-user network service demonstrating all of the major principles of programming in Go.
Presentation explains advanced HTTP caching mechanisms like decomposition, stale content delivery, purging based on tags and caching of user-specific data.
The document is a presentation on high performance PHP. It discusses profiling PHP applications to identify bottlenecks, code-level optimizations that can provide gains, and big wins like upgrading PHP versions and using APC correctly. It also covers load testing tools like JMeter and key takeaways like focusing on big wins and caching.
ApacheConNA 2015: What's new in Apache httpd 2.4Jim Jagielski
The document discusses the new features of Apache HTTP Server version 2.4, including performance improvements through more efficient modules and data structures, enhanced configuration options, new modules for capabilities like Lua scripting and remote IP access, and improved proxy functionality for dynamic and cloud environments. Key areas covered are performance, configuration, new modules, and proxy features.
The document discusses HTTP and web architectures. It begins with introductions from Nicolas Martignole and Quentin Adam. It then provides an overview of HTTP1 including that it is a text-based specification, uses simple requests and responses over TCP connections, and defines verbs like GET, POST, PUT, and DELETE. It discusses techniques for caching like Expires, Pragma, and Cache-Control headers. It also covers ETags for cache validation and content negotiation for serving multiple representations of resources.
- HipHop – replacement for Zend PHP
- HPHPc and HHVM
- Supported OS
- Compatibility with PHP: version, extensions
- Operational modes: CLI, Server
- Configuration features
- Performance: capital.ua on Symfony 1.4, Sylius on Symfony 2.3
- HHVM with your project: Vagrant
- Popular frameworks and CMS support
- Competitors: kPHP
This document summarizes an introduction to profiling presentation. It discusses using the cProfile module to generate profile data and analyze it using tools like pstats. It also discusses using the results to identify bottlenecks by looking at exclusive time functions or walking down the call graph from inclusive time functions. Common optimizations mentioned include removing unnecessary work, using more efficient algorithms, batching I/O operations, database and SQL tuning, caching, and reducing code complexity.
The document discusses the Elastic Stack, which is a suite of open source tools for data ingestion, enrichment, storage, analysis, and visualization. It includes Logstash for data collection and processing, Elasticsearch for searching and analyzing, and Kibana for visualizing data. The document provides examples of Logstash configuration with input, filter, and output plugins and demonstrates how to compose an Elastic Stack pipeline to collect and analyze web server logs.
The document discusses the history and fundamentals of interactive web technologies. It begins with HTTP and its limitations for pushing data from server to client. It then covers early techniques like meta refresh and AJAX polling. It discusses longer polling, HTTP chunked responses, and forever frames. It introduces Comet and web sockets as solutions providing true real-time bidirectional communication. It also covers server-sent events. In conclusion, it recommends using all these techniques together and frameworks like Socket.IO and SignalR that abstract the complexities and provide high-level APIs.
This document summarizes a presentation about scaling PHP applications to handle large traffic volumes. Some key points:
- The speaker is a performance engineer at Etsy who helped scale their PHP application to support 60 million unique visitors per month.
- Etsy's PHP application handles 1.5 billion page views per month on Apache and PHP servers. They use techniques like opcode caching, static arrays for translations, and atomic deploys to optimize performance.
- The presentation covers tools and technologies used at Etsy like Memcached, MySQL, and offloading static content to CDNs. It also discusses challenges of scaling further and potential architecture changes.
Keep hearing about Plack and PSGI, and not really sure what they're for, and why they're popular? Maybe you're using Plack at work, and you're still copying-and-pasting `builder` lines in to your code without really knowing what's going on? What's the relationship between Plack, PSGI, and CGI? Plack from first principles works up from how CGI works, the evolution that PSGI represents, and how Plack provides a user-friendly layer on top of that.
Altitude San Francisco 2018: Programming the EdgeFastly
Programming the edge
Second floor
Andrew Betts
Principal Developer Advocate, Fastly
Hide abstract
Through our support for running your own code on our edge servers, Fastly's network offers you a platform of unparalleled speed, reliability and efficiency to which you can delegate a surprising amount of logic that has traditionally been in the application layer. In this workshop, you'll implement a series of advanced edge solutions, and learn how to apply these patterns to your own applications to reduce your origin load, dramatically improve performance, and make your applications more secure.
The document discusses various technologies for real-time web applications including PSGI, Plack, AnyEvent, AnyMQ, server-push technologies like Comet, WebSockets, and the Web::Hippie and Web::Hippie::Pipe modules. It provides code examples of using AnyEvent and POE for asynchronous programming, AnyMQ for publishing messages to different message queues, and Web::Hippie::Pipe for abstracting persistent bidirectional connections. The document advocates for relaxing the definition of "hippies" to support more connection types and demonstrates how Hippie::Pipe can provide a unified interface.
"Swoole: double troubles in c", Alexandr VronskiyFwdays
Practices in using Swoole ecosystem & migration real production marketplace app to async approach. Which benefits we got and what problems happens on stack with PHP8, Postgresql, Redis, RebbitMQ, Doctrine, coroutines/fibers, concurrency HTTP Server.
Site Performance Optimization for Joomla #jwc13Hans Kuijpers
It's easy to improve the speed of your Joomla website. Just follow the tips & tricks of this presentation about Site Performance Optimization. These are the slides used during the Joomla World Conference 2013 in Boston #jwc13
Genkidama is a P2P content distribution system built using Java and DHT techniques. It uses NicoCache for storage and OpenChord for the DHT overlay. It supports 300 concurrent users and was developed by Daiki for uses including P2P SIP and livedoor. It provides a web dashboard and integrates various technologies like NAT traversal, XMLRPC, and a GUI.
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio LopesCaelum
The document discusses HTTP 2.0 and SPDY. Some key points include:
1. HTTP 2.0 uses a binary format instead of text and allows multiplexing requests over a single TCP connection to reduce latency.
2. Features like header compression, server push and request prioritization help optimize loading of web pages.
3. SPDY is an experimental protocol developed by Google that implements many of the same optimizations as HTTP 2.0.
Varnish is a reverse proxy cache that is designed to accelerate HTTP-based websites. It uses a domain-specific configuration language called VCL to define backend servers, caching rules, and other settings. Key aspects of the Varnish configuration covered include backend definitions, directors, vcl_recv for caching rules, vcl_hash for object identification, and vcl_fetch for backend object handling. The document discusses using Varnish to cache the homepage of a website called KeezMovies, addressing challenges of geolocation, analytics cookies, and non-idempotent requests.
ApacheCon 2014 - What's New in Apache httpd 2.4Jim Jagielski
The document summarizes new features in Apache HTTPD version 2.4, including improved performance through the Event MPM, faster APR, and reduced memory usage. It describes new configuration options like finer timeout controls and the <If> directive. New modules like mod_lua and mod_proxy submodules are highlighted. The document also discusses how Apache has adapted to cloud computing through dynamic proxying, load balancing, and self-aware environments.
This document provides an overview of using caching to serve visitor-specific content quickly while avoiding server-side sessions. It discusses using HTTP caching headers, a reverse proxy like Varnish, and the Symfony cache to cache responses varying by target groups identified in request cookies. The target groups are reevaluated on cache hits by making conditional requests in the reverse proxy layer using Varnish configuration.
The document discusses configuring Nginx and PHP-FPM for high performance websites. Some key points:
- Nginx is a lightweight and fast HTTP server that is well-suited for high traffic loads. It can be used as a web server, reverse proxy, load balancer, and more.
- PHP-FPM (PHP FastCGI Process Manager) runs PHP processes as a pool that is separate from the web server for better isolation and performance. Nginx communicates with PHP-FPM via FastCGI.
- Benchmark results show Nginx performing better than Apache, especially under high concurrency loads. Caching with Nginx and Memcached can further improve
Google's Go is a relatively new systems programming language that has recently gained a lot of traction with developers. It brings together the ease and efficiency of development in modern interpreted languages like Python, Perl, and Ruby with the efficiency and safety of a statically typed, compiled language like C/C++ and Java.
On top of that, Go is a language built for modern hardware and problems. With built-in support for concurrency, programmers can easily build software to scale up to today's many-core beasts. Programming in Go is really nice, and in this tutorial, you will learn why.
We will cover an introduction to the Go programming language, and together we will build a multi-user network service demonstrating all of the major principles of programming in Go.
Presentation explains advanced HTTP caching mechanisms like decomposition, stale content delivery, purging based on tags and caching of user-specific data.
The document is a presentation on high performance PHP. It discusses profiling PHP applications to identify bottlenecks, code-level optimizations that can provide gains, and big wins like upgrading PHP versions and using APC correctly. It also covers load testing tools like JMeter and key takeaways like focusing on big wins and caching.
ApacheConNA 2015: What's new in Apache httpd 2.4Jim Jagielski
The document discusses the new features of Apache HTTP Server version 2.4, including performance improvements through more efficient modules and data structures, enhanced configuration options, new modules for capabilities like Lua scripting and remote IP access, and improved proxy functionality for dynamic and cloud environments. Key areas covered are performance, configuration, new modules, and proxy features.
The document discusses HTTP and web architectures. It begins with introductions from Nicolas Martignole and Quentin Adam. It then provides an overview of HTTP1 including that it is a text-based specification, uses simple requests and responses over TCP connections, and defines verbs like GET, POST, PUT, and DELETE. It discusses techniques for caching like Expires, Pragma, and Cache-Control headers. It also covers ETags for cache validation and content negotiation for serving multiple representations of resources.
- HipHop – replacement for Zend PHP
- HPHPc and HHVM
- Supported OS
- Compatibility with PHP: version, extensions
- Operational modes: CLI, Server
- Configuration features
- Performance: capital.ua on Symfony 1.4, Sylius on Symfony 2.3
- HHVM with your project: Vagrant
- Popular frameworks and CMS support
- Competitors: kPHP
This document summarizes an introduction to profiling presentation. It discusses using the cProfile module to generate profile data and analyze it using tools like pstats. It also discusses using the results to identify bottlenecks by looking at exclusive time functions or walking down the call graph from inclusive time functions. Common optimizations mentioned include removing unnecessary work, using more efficient algorithms, batching I/O operations, database and SQL tuning, caching, and reducing code complexity.
The document discusses the Elastic Stack, which is a suite of open source tools for data ingestion, enrichment, storage, analysis, and visualization. It includes Logstash for data collection and processing, Elasticsearch for searching and analyzing, and Kibana for visualizing data. The document provides examples of Logstash configuration with input, filter, and output plugins and demonstrates how to compose an Elastic Stack pipeline to collect and analyze web server logs.
The document discusses the history and fundamentals of interactive web technologies. It begins with HTTP and its limitations for pushing data from server to client. It then covers early techniques like meta refresh and AJAX polling. It discusses longer polling, HTTP chunked responses, and forever frames. It introduces Comet and web sockets as solutions providing true real-time bidirectional communication. It also covers server-sent events. In conclusion, it recommends using all these techniques together and frameworks like Socket.IO and SignalR that abstract the complexities and provide high-level APIs.
This document summarizes a presentation about scaling PHP applications to handle large traffic volumes. Some key points:
- The speaker is a performance engineer at Etsy who helped scale their PHP application to support 60 million unique visitors per month.
- Etsy's PHP application handles 1.5 billion page views per month on Apache and PHP servers. They use techniques like opcode caching, static arrays for translations, and atomic deploys to optimize performance.
- The presentation covers tools and technologies used at Etsy like Memcached, MySQL, and offloading static content to CDNs. It also discusses challenges of scaling further and potential architecture changes.
Keep hearing about Plack and PSGI, and not really sure what they're for, and why they're popular? Maybe you're using Plack at work, and you're still copying-and-pasting `builder` lines in to your code without really knowing what's going on? What's the relationship between Plack, PSGI, and CGI? Plack from first principles works up from how CGI works, the evolution that PSGI represents, and how Plack provides a user-friendly layer on top of that.
Altitude San Francisco 2018: Programming the EdgeFastly
Programming the edge
Second floor
Andrew Betts
Principal Developer Advocate, Fastly
Hide abstract
Through our support for running your own code on our edge servers, Fastly's network offers you a platform of unparalleled speed, reliability and efficiency to which you can delegate a surprising amount of logic that has traditionally been in the application layer. In this workshop, you'll implement a series of advanced edge solutions, and learn how to apply these patterns to your own applications to reduce your origin load, dramatically improve performance, and make your applications more secure.
The document discusses various technologies for real-time web applications including PSGI, Plack, AnyEvent, AnyMQ, server-push technologies like Comet, WebSockets, and the Web::Hippie and Web::Hippie::Pipe modules. It provides code examples of using AnyEvent and POE for asynchronous programming, AnyMQ for publishing messages to different message queues, and Web::Hippie::Pipe for abstracting persistent bidirectional connections. The document advocates for relaxing the definition of "hippies" to support more connection types and demonstrates how Hippie::Pipe can provide a unified interface.
"Swoole: double troubles in c", Alexandr VronskiyFwdays
Practices in using Swoole ecosystem & migration real production marketplace app to async approach. Which benefits we got and what problems happens on stack with PHP8, Postgresql, Redis, RebbitMQ, Doctrine, coroutines/fibers, concurrency HTTP Server.
Site Performance Optimization for Joomla #jwc13Hans Kuijpers
It's easy to improve the speed of your Joomla website. Just follow the tips & tricks of this presentation about Site Performance Optimization. These are the slides used during the Joomla World Conference 2013 in Boston #jwc13
Genkidama is a P2P content distribution system built using Java and DHT techniques. It uses NicoCache for storage and OpenChord for the DHT overlay. It supports 300 concurrent users and was developed by Daiki for uses including P2P SIP and livedoor. It provides a web dashboard and integrates various technologies like NAT traversal, XMLRPC, and a GUI.
HTTP/2, SPDY e Otimizações Web - Front In Maceió 2014 - Sérgio LopesCaelum
The document discusses HTTP 2.0 and SPDY. Some key points include:
1. HTTP 2.0 uses a binary format instead of text and allows multiplexing requests over a single TCP connection to reduce latency.
2. Features like header compression, server push and request prioritization help optimize loading of web pages.
3. SPDY is an experimental protocol developed by Google that implements many of the same optimizations as HTTP 2.0.
Varnish is a reverse proxy cache that is designed to accelerate HTTP-based websites. It uses a domain-specific configuration language called VCL to define backend servers, caching rules, and other settings. Key aspects of the Varnish configuration covered include backend definitions, directors, vcl_recv for caching rules, vcl_hash for object identification, and vcl_fetch for backend object handling. The document discusses using Varnish to cache the homepage of a website called KeezMovies, addressing challenges of geolocation, analytics cookies, and non-idempotent requests.
ApacheCon 2014 - What's New in Apache httpd 2.4Jim Jagielski
The document summarizes new features in Apache HTTPD version 2.4, including improved performance through the Event MPM, faster APR, and reduced memory usage. It describes new configuration options like finer timeout controls and the <If> directive. New modules like mod_lua and mod_proxy submodules are highlighted. The document also discusses how Apache has adapted to cloud computing through dynamic proxying, load balancing, and self-aware environments.
This document provides an overview of using caching to serve visitor-specific content quickly while avoiding server-side sessions. It discusses using HTTP caching headers, a reverse proxy like Varnish, and the Symfony cache to cache responses varying by target groups identified in request cookies. The target groups are reevaluated on cache hits by making conditional requests in the reverse proxy layer using Varnish configuration.
Less and faster – Cache tips for WordPress developersSeravo
Otto Kekäläinen, the code-loving CEO of Seravo held a webinar on May 12, 2020, that focused on the cache: what should a WordPress developer know and which are the best practices to follow?
Drupal Performance - SerBenfiquista.com Case Studyhernanibf
This document summarizes a case study about optimizing the performance of a large Drupal website for a Portuguese sports fan community. The site was experiencing slow performance due to legacy code and high traffic volumes. Key steps taken to optimize performance included migrating to Drupal and Pressflow, extensive caching, switching to Nginx web server, using memcache for caching and sessions, and ongoing iterative improvements. These changes helped improve site performance and scalability to handle over 8000 daily visits and 185,000 pageviews.
What's New and Newer in Apache httpd-24Jim Jagielski
Jim Jagielski presents an overview of new features and enhancements in Apache HTTP Server version 2.4, including configuration and runtime improvements, new modules and capabilities, cloud and proxy enhancements, performance increases, and support for HTTP/2. Key highlights include finer-grained configuration controls, new modules like mod_lua and mod_macro, improved proxy and load balancing functionality, better performance through optimizations and new MPMs like Event, and initial HTTP/2 support.
Apache and PHP: Why httpd.conf is your new BFF!Jeff Jones
Apache's configuration files can be used to configure how Apache operates, but they can also be used to configure PHP and how Apache httpd interacts with PHP. In this talk, Jeff explains the different ways Apache can be configured, explains many of the useful config options available for Apache modules, including our own mod_php, and showcases example of how they can be used with, and instead of, your PHP code.
My slides from WordCamp Dhaka 2019 on WordPress Scaling. In this session I explained performance optimisation using HTTP/2, Caching and compressing resources.
I also explained how to Dockerize WordPress to make it easier to scale.
How we use Varnish at Opera Software, from the beginning (2009) to now.
Presentation hold for the 5th Varnish Users Group meeting (VUG5) held in Paris on March 22nd 2012.
The document discusses various techniques for enabling offline functionality in Ajax applications, including browser storage options like cookies, Firefox offline storage, and Flash shared objects. It also covers approaches for pushing data from server to client like polling, asynchronous servlets, Comet, and piggybacking on other responses. The document concludes with considerations for optimizing Ajax performance such as data formats, bandwidth usage, and client-side processing.
Caching and tuning fun for high scalabilityWim Godden
Caching has been a 'hot' topic for a few years. But caching takes more than merely taking data and putting it in a cache : the right caching techniques can improve performance and reduce load significantly. But we'll also look at some major pitfalls, showing that caching the wrong way can bring down your site. If you're looking for a clear explanation about various caching techniques and tools like Memcached, Nginx and Varnish, as well as ways to deploy them in an efficient way, this talk is for you.
In this workshop, we’ll reveal how improving your caching strategy speeds up page loads with little effort. We’ll follow an HTTP request through Fastly and deep dive into cache hit ratios. In practical sessions, we’ll explain how to optimize your hit rate and still serve fresh content to users. We’ll cover caching headers, invalidation and the effect on user-perceived loading experience.
Modern javascript localization with c-3po and the good old gettextAlexander Mostovenko
This document summarizes a presentation about localization in modern JavaScript applications using GNU gettext. Some key points:
- GNU gettext is recommended over ICU due to better tooling and compatibility with existing backend formats.
- C-3po is an open source library that improves on gettext by allowing extraction and resolution of translations directly from JavaScript code using tagged template literals.
- It implements an extraction/merge/resolve workflow that allows developers and translators to work independently and precompiles translations for faster loading.
The document provides an overview of basic web security concepts including:
1. It defines common web terms like front-end, back-end, cookies, sessions, URLs, HTTP methods, headers and status codes.
2. It discusses how cookies and sessions are used to track users and maintain state on the web.
3. It covers potential information leaks from files like robots.txt, hidden files and directories as well as techniques for searching websites like Google hacking.
4. It introduces common web vulnerabilities like XSS, CSRF and discusses how attacks are carried out and potential impacts. It also notes some PHP quirks that could be exploited if not understood.
The document discusses the term "varnish" and provides definitions. It defines varnish as having a deceptively attractive external appearance or outward show. It further defines varnished and varnishing as giving a smooth and glossy finish to something. The rest of the document is about configuring and using the Varnish caching system.
Most of us are familiar with HTTP, but when it actually comes to creating cacheable web content, there is still a lot to be learned. In this presentation I will show you how to leverage specific mechanism to achieve a good hit rate without losing touch with some of the challenges of real-life web projects. Keywords: cache control, cache variations, conditional requests, stateful content, HTTP fragments, invalidation. The goals is to empower developers to control the behavior of reverse caching proxies like Varnish, Content Delivery Networks, or even browser cache, using the power of HTTP.
Most of us are familiar with HTTP, but when it actually comes to creating cacheable web content, there is still a lot to be learned. In this presentation I will show you how to leverage specific mechanism to achieve a good hit rate without losing touch with some of the challenges of real-life web projects. Keywords: cache control, cache variations, conditional requests, stateful content, HTTP fragments, invalidation. The goals is to empower developers to control the behavior of reverse caching proxies like Varnish, Content Delivery Networks, or even browser cache, using the power of HTTP.
OWASP Top 10 - Checkmarx Presentation at Polytechnic Institute of Cávado and AveCheckmarx
Presented by Paulo Silva, Security Researcher at Checkmarx on October 31, 2018 at Polytechnic Institute of Cávado and Ave.
Learn all about the OWASP Top 10 from his talk:
Part I
Web Application architecture
The HTTP protocol
HTTP Request walk-through
Part II
What is OWASP
What is the OWASP TOP 10
OWASP Top 10 walk - through
Choosing A Proxy Server - Apachecon 2014bryan_call
This document summarizes a presentation about choosing a proxy server. It discusses several popular proxy options including Apache Traffic Server (ATS), Nginx, Squid, Varnish, and Apache HTTP Server. It covers the types of proxies each supports, features, architectures, caching, performance, and pros and cons. Benchmark tests show ATS has the best cache scaling and performance overall while using less CPU than alternatives like Squid. Nginx and Squid had some issues with latency and HTTP compliance. The document recommends ATS as a good choice for its scaling, efficient caching, and plugin support.
Similar to Developing cacheable PHP applications - Confoo 2018 (20)
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
10 things that helped me advance my career - PHP UK Conference 2024Thijs Feryn
Slides for my opening keynote at the PHP UK Conference 2024 in London.
See https://feryn.eu/presentations/10-things-that-helped-me-advance-my-career-php-uk-conference-2024 for more information and the video footage
Distributed load testing with K6 - NDC London 2024Thijs Feryn
This presentation at NDC London 2024 is about the K6 load testing tool. It features the basics, but also explains how you can use it to perform distributed load testing and store test results in Prometheus.
See https://feryn.eu/presentations/distributed-load-testing-k6-ndc-london-2024 for more information.
HTTP headers that make your website go faster - devs.gent November 2023Thijs Feryn
The slides for me "HTTP headers that make your website go faster" presentation at the November 2023 meetup of devs.gent.
This presentation explains how you can leverage headers like Cache-Control, Vary, Etag, If-None-Match, Surrogate-Capability, Surrogate-Control and many others to control the behavior of an HTTP cache or CDN.
See https://feryn.eu/speaking/http-headers-will-make-website-go-faster-devs-gent-23/ for more information.
Slides for my "Living on the edge" presentation at the EBU Horizons 2023 Conference in Geneva (Switzerland).
The subtitle for this presentation is "leveraging satellites, 5G networks and edgecasting for smarter content delivery".
See https://feryn.eu/speaking/living-on-the-edge-ebu-horizons-23/ for more information.
Distributed Load Testing with k6 - DevOps BarcelonaThijs Feryn
Slides for My "Distributed Load Testing with k6" presentation at DevOps Barcelona 2023.
In this presentation I introduce k6, the open source load testing tool by Grafana Labs.
I show how to write tests in Javascript, how to run the tests using the CLI tools and how to measure the right results and configure the right checks, metrics & thresholds.
In terms of distributed testing, I also talk about the built-in API that allows you to remotely trigger tests from different machines and how to centralize and visualize real-time metrics using Prometheus and Grafana.
See https://feryn.eu/speaking/distributed-load-testing-k6-devops-barcelona-23/ for more information.
Core web vitals meten om je site sneller te maken - Combell Partner Day 2023Thijs Feryn
Slides for my presentation at the Combell Partner Day 2023 in Gent (Belgium).
See https://feryn.eu/speaking/core-web-vitals-meten-om-je-site-sneller-te-maken-combell-partner-day-2023/ for more details about the event.
HTTP headers that make your website go fasterThijs Feryn
Slides for my HTTP caching headers talk at SRECon EMEA 2023 in Dublin.
This presentation focuses heavily on the "Cache-Control" header and all the directives that give you the ability to control the behavior of the cache. Other caching headers such as "Vary", "Etag", "If-None-Match", "If-Modified-Since" & "Last-Modified" are also covered.
Finally we talk about Edge Side Includes (ESI) as well.
See https://feryn.eu/speaking/http-headers-make-website-go-faster-srecon23emea/ for more details.
HTTP headers that will make your website go fasterThijs Feryn
This document discusses caching and web performance optimization. It introduces caching concepts like private vs shared caches, time to live, fresh vs stale content, and revalidation. It covers Cache-Control response directives and how to configure caching in Varnish. Key points covered include why caching improves performance, different types of caching (e.g. CDNs, proxies), and how to implement caching strategies using Cache-Control, VCL, and edge computing.
Slides for my k6 load testing presentation at Confoo 2023 in Montreal Canada.
See https://feryn.eu/speaking/distributed-load-testing-k6-confoo23/ for more information.
HTTP logging met Varnishlog - PHPWVL 2022Thijs Feryn
This document discusses HTTP logging and Varnish log formats. It provides examples of Varnish log output showing request information like IP address, request method, URL, status code, timestamp and more. It also covers Varnish log filtering techniques like grouping transactions, including/excluding tags, and using Varnishlog queries.
Taking Laravel to the edge with HTTP caching and VarnishThijs Feryn
Slides for my Laracon EU 2022 presentation in Amsterdam about caching Laravel applications with Varnish.
See https://feryn.eu/speaking/taking-laravel-edge-leverage-http-caching-varnish-maximum-scalability/ for more information.
Build your own CDN with Varnish - Confoo 2022Thijs Feryn
Slides for my Confoo 2022 presentation on how to create your own Content Delivery Network using Varnish.
See https://feryn.eu/speaking/build-cdn-varnish-confoo22/ for more information
Caching the uncacheable with Varnish - DevDays 2021Thijs Feryn
Slides for my "Caching the uncacheable with Varnish" presentation at DevDays 2021. See https://feryn.eu/speaking/caching-uncacheable-varnish-devdays-2021/ for more information
This document discusses developing cacheable backend applications. It covers topics like identifying slow parts of an application to optimize, using caching to improve performance once optimization limits are reached, different HTTP caching mechanisms, conditional requests to only fetch changed data, edge caching with reverse proxies, content composition with placeholders, cache variations based on request headers, purging cached content, and strategies when caching HTTP responses is not possible. The target is to design software with caching in mind from the start for improved control and consistent caching behavior.
How Cloud addresses the needs of todays internet - Korazon 2018Thijs Feryn
Corporate presentation for Korazon.
In this talk I give a behind-the-scenes look at what the Cloud is about in 2018. From basic terms like SaaS, PaaS, IaaS, to cutting-edge technology like Kubernetes and the Cloud Native Computing Foundation.
This talk is about modern Cloud technology for non-technical people.
See https://feryn.eu/speaking/how-cloud-addresses-the-needs-of-todays-internet-korazon-2018/ for more information about this presentation.
This presentation provides valuable insights into effective cost-saving techniques on AWS. Learn how to optimize your AWS resources by rightsizing, increasing elasticity, picking the right storage class, and choosing the best pricing model. Additionally, discover essential governance mechanisms to ensure continuous cost efficiency. Whether you are new to AWS or an experienced user, this presentation provides clear and practical tips to help you reduce your cloud costs and get the most out of your budget.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...alexjohnson7307
Predictive maintenance is a proactive approach that anticipates equipment failures before they happen. At the forefront of this innovative strategy is Artificial Intelligence (AI), which brings unprecedented precision and efficiency. AI in predictive maintenance is transforming industries by reducing downtime, minimizing costs, and enhancing productivity.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
21. ✓Stateless
✓Well-defined TTL
✓Cache / no-cache per resource
✓Cache variations
✓Conditional requests
✓HTTP fragments for non-
cacheable content
In an ideal world
35. <?php
namespace AppController;
use SymfonyComponentHttpFoundationRequest;
use SensioBundleFrameworkExtraBundleConfigurationRoute;
use SymfonyBundleFrameworkBundleControllerController;
class DefaultController extends Controller
{
/**
* @Route("/", name="home")
*/
public function index()
{
return $this->render('index.twig');
}
}
src/Controller/DefaultController.php
37. {% extends "base.twig" %}
{% block title %}Home{% endblock %}
{% block content %}
<div class="page-header">
<h1>{{ 'example' | trans }}</h1>
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris consequat orci
eget libero sollicitudin, non ultrices turpis mollis. Aliquam sit amet tempus elit.
Ut viverra risus enim, ut venenatis justo accumsan nec. Praesent a dolor tellus.
Maecenas non mauris leo. Pellentesque lobortis turpis at dapibus laoreet. Mauris
rhoncus nulla et urna mollis, et lobortis magna ornare. Etiam et sapien consequat,
egestas felis sit amet, dignissim enim.</p>
<p>Quisque quis mollis justo, imperdiet fermentum velit. Aliquam nulla justo,
consectetur et diam non, luctus commodo metus. Vestibulum fermentum efficitur nulla
non luctus. Nunc lorem nunc, mollis id efficitur et, aliquet sit amet ante. Sed
ipsum turpis, vehicula eu semper eu, malesuada eget leo. Vestibulum venenatis dui
id pulvinar suscipit. Etiam nec massa pharetra justo pharetra dignissim quis non
magna. Integer id convallis lectus. Nam non ullamcorper metus. Ut vestibulum ex ut
massa posuere tincidunt. Vestibulum hendrerit neque id lorem rhoncus aliquam. Duis
a facilisis metus, a faucibus nulla.</p>
{% endblock %}
templates/index.twig
40. home: Home
welcome : Welcome to the site
rendered : Rendered at %date%
example : An example page
log_in : Log in
login : Login
log_out : Log out
username : Username
password : Password
private : Private
privatetext : Looks like some very private data
translations/messages.en.yml
41. home: Start
welcome : Welkom op de site
rendered : Samengesteld op %date%
example : Een voorbeeldpagina
log_in : Inloggen
login : Login
log_out : Uitloggen
username : Gebruikersnaam
password : Wachtwoord
private : Privé
privatetext : Deze tekst ziet er vrij privé uit
translations/messages.nl.yml
42. <?php
namespace AppEventListener;
use SymfonyComponentHttpKernelEventGetResponseEvent;
class LocaleListener
{
public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
$preferredLanguage = $request->getPreferredLanguage();
if(null !== $preferredLanguage) {
$request->setLocale($preferredLanguage);
}
}
}
src/EventListener/LocaleListener.php
73. ✓ Server-side
✓ Standardized
✓ Processed on the
“edge”, no in the
browser
✓ Generally faster
Edge-Side Includes
- Sequential
- One fails, all fail
- Limited
implementation in
Varnish
74. ✓ Client-side
✓ Common knowledge
✓ Parallel processing
✓ Graceful
degradation
AJAX
- Processed by the
browser
- Extra roundtrips
- Somewhat slower