SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
EVENT MANAGER
PUBLISHER - SUBSCRIBERS


• Made   the code we had for behaviors, helpers, components,
 etc. into a reusable generic events system

• Theidea is simple: an object publishes a named event with
 some data and an unknown list of listeners will get notified
 and have the chance of changing the outcome of the original
 operation
SOME BUILT-IN EVENTS

• Model.beforeValidate,
                     Model.afterValidate,
 Model.beforeSave, Model.afterSave...

• Controller.initialize,
                     Controller.startup,
 Controller.beforeRender...

• View.beforeRender,       View.beforeLayout...

• Dispatcher.beforeDispatch,      Dispatcher.afterDispatch
CREATE YOUR OWN EVENTS!

•A Paypal plugin received a notification from payments server.
 What do you do? (You need to send emails, mark order s
 processed, decrement stock...)

• Trigger   a new Paypal.afterProcess event!

• Any number of listeners can processes the rest of the actions
 for you while leaving the Paypal plugin free of any external
 concerns
A SIMPLE EXAMPLE
SUBSCRIPTION PATTERNS

• Direct: during
              runtime an object attaches event listeners to
 another as needed

• Configuration  based: define a list or listeners. Read the list in
 the publisher class or factory when needed

• Indirectglobal: Use the global event manager to attach
 indirectly to any event.

• Conventionbased: load listeners for an object from a
 convention-defined location
USING THE GLOBAL
    MANAGER
DISPATCHER FILTERS
  Let’s jump directly to examples :)
AN ASSET COMPRESSOR
A RESPONSE CACHER
SOME COOL IDEAS WITH
            FILTERS


• Complete    reverse proxy

• Pluggable   OAuth Authorization

• Performance    monitoring
HTTP CACHING
TYPES OF CACHE


• Browser   caches

• Proxy   caches

• Gateway   caches (or reverse proxy)
HEADERS INVOLVED IN
              CACHING

• Cache-Control   - This it the most important one

• Expires

• ETag

• Last-Modified
MESSING WITH CACHE-
      CONTROL




  Proxies use shared cache, so setting a
response as private will not be cached by
                 default
VALIDATION VS EXPIRATION


• Expiration
          model: you specify for how long a response is valid,
 new requests will not be made until time expires

• Validation: requests
                     are made every time and server responds
 with either a 304 status or a new response.
MESSING WITH EXPIRATION




Using max-age and s-maxage is preferred because of
several limitations in the Expire header
VALIDATION MODEL




If browser send If-Modified-Since header, then a 304
response will be issued and view rendering process will
be skipped entirely
CONDITIONAL VIEW RENDER




Same as previous example, but automatic and awesome
CACHE GROUPS
WHAT ARE THEY?


•A  declarative, static way of tagging cache entries with any
 string

• Entries
        tagged with the same string can be invalidated all at
 the same time in an atomic way

•A   way to organize your cache entries into logical groups
A SIMPLE EXAMPLE
CACHE GROUPS FACTS

• Clearingall entries under a groups will delete all entries for all
 Cache configurations having the same groups in them and
 sharing the same prefix. Even across engines!

• Youcannot dynamically add new groups to cache
 configurations, you need to plan your strategy

• You*could* dynamically create cache configs having exactly
 the groups you want to tag entries with, but it’s super hard
MODEL VALIDATOR
WHAT FOR?

• Some applications require dynamic validations rules depending
 on the action being executed

• Directly   modifying $validate property on the model can be
 tricky

• Severalparts of CakePHP had to implement the same
 $validates parsing to extract information out of it
WHAT CAN I DO WITH IT?


• Dynamically   inspect, add or remove validations rules for a
 model

• Swap   at runtime validation objects depending on your own
 logic

• Create   with an easy API complex validation systems
ADDING NEW RULES
MODIFYING RULES
DELETING RULES
USING ARRAY ACCESS

Weitere ähnliche Inhalte

Was ist angesagt?

Akka and AngularJS – Reactive Applications in Practice
Akka and AngularJS – Reactive Applications in PracticeAkka and AngularJS – Reactive Applications in Practice
Akka and AngularJS – Reactive Applications in PracticeRoland Kuhn
 
"Design First" APIs with Swagger
"Design First" APIs with Swagger"Design First" APIs with Swagger
"Design First" APIs with Swaggerscolestock
 
AWS Webcast - Customizing AWS ops works with chef 11 and Amazon machine images
AWS Webcast - Customizing AWS ops works with chef 11 and Amazon machine imagesAWS Webcast - Customizing AWS ops works with chef 11 and Amazon machine images
AWS Webcast - Customizing AWS ops works with chef 11 and Amazon machine imagesAmazon Web Services
 
SmartNews's journey into microservices
SmartNews's journey into microservicesSmartNews's journey into microservices
SmartNews's journey into microservicesSmartNews, Inc.
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaAmazon Web Services
 
AWS Meetup - Nordstrom Data Lab and the AWS Cloud
AWS Meetup - Nordstrom Data Lab and the AWS CloudAWS Meetup - Nordstrom Data Lab and the AWS Cloud
AWS Meetup - Nordstrom Data Lab and the AWS CloudNordstromDataLab
 
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & ProcessesAmazon Web Services
 
Microservices on top of kafka
Microservices on top of kafkaMicroservices on top of kafka
Microservices on top of kafkaLivePerson
 
Scaling Your First 1000 Containers with Docker
Scaling Your First 1000 Containers with DockerScaling Your First 1000 Containers with Docker
Scaling Your First 1000 Containers with DockerAtlassian
 
AWS DevOps Event - AWS Services enabling DevOps - Continuous Integration & Au...
AWS DevOps Event - AWS Services enabling DevOps - Continuous Integration & Au...AWS DevOps Event - AWS Services enabling DevOps - Continuous Integration & Au...
AWS DevOps Event - AWS Services enabling DevOps - Continuous Integration & Au...Ian Massingham
 
Serverless data processing with Data Pipeline
Serverless data processing with Data PipelineServerless data processing with Data Pipeline
Serverless data processing with Data PipelineRadek Miazio
 
Common issues with Apache Kafka® Producer
Common issues with Apache Kafka® ProducerCommon issues with Apache Kafka® Producer
Common issues with Apache Kafka® Producerconfluent
 
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Surati Tech Talks 2022 / Build reliable Svelte applications using CypressSurati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Surati Tech Talks 2022 / Build reliable Svelte applications using CypressMaurice De Beijer [MVP]
 
WinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release PipelinesWinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release PipelinesWinOps Conf
 
(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument
(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument
(DVO205) Monitoring Evolution: Flying Blind to Flying by InstrumentAmazon Web Services
 
DevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating DeploymentsDevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating DeploymentsAmazon Web Services
 
CQRS + ES with Scala and Akka
CQRS + ES with Scala and AkkaCQRS + ES with Scala and Akka
CQRS + ES with Scala and AkkaBharadwaj N
 
Nordstrom Data Lab Recommendo API with Node.js
Nordstrom Data Lab Recommendo API with Node.jsNordstrom Data Lab Recommendo API with Node.js
Nordstrom Data Lab Recommendo API with Node.jsDavid Von Lehman
 
Enterprise Beacon Object Hive - Siebel Version Control
Enterprise Beacon Object Hive - Siebel Version ControlEnterprise Beacon Object Hive - Siebel Version Control
Enterprise Beacon Object Hive - Siebel Version ControlMilind Waikul
 

Was ist angesagt? (20)

Akka and AngularJS – Reactive Applications in Practice
Akka and AngularJS – Reactive Applications in PracticeAkka and AngularJS – Reactive Applications in Practice
Akka and AngularJS – Reactive Applications in Practice
 
"Design First" APIs with Swagger
"Design First" APIs with Swagger"Design First" APIs with Swagger
"Design First" APIs with Swagger
 
AWS Webcast - Customizing AWS ops works with chef 11 and Amazon machine images
AWS Webcast - Customizing AWS ops works with chef 11 and Amazon machine imagesAWS Webcast - Customizing AWS ops works with chef 11 and Amazon machine images
AWS Webcast - Customizing AWS ops works with chef 11 and Amazon machine images
 
SmartNews's journey into microservices
SmartNews's journey into microservicesSmartNews's journey into microservices
SmartNews's journey into microservices
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
 
AWS Meetup - Nordstrom Data Lab and the AWS Cloud
AWS Meetup - Nordstrom Data Lab and the AWS CloudAWS Meetup - Nordstrom Data Lab and the AWS Cloud
AWS Meetup - Nordstrom Data Lab and the AWS Cloud
 
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
 
Microservices on top of kafka
Microservices on top of kafkaMicroservices on top of kafka
Microservices on top of kafka
 
Scaling Your First 1000 Containers with Docker
Scaling Your First 1000 Containers with DockerScaling Your First 1000 Containers with Docker
Scaling Your First 1000 Containers with Docker
 
AWS DevOps Event - AWS Services enabling DevOps - Continuous Integration & Au...
AWS DevOps Event - AWS Services enabling DevOps - Continuous Integration & Au...AWS DevOps Event - AWS Services enabling DevOps - Continuous Integration & Au...
AWS DevOps Event - AWS Services enabling DevOps - Continuous Integration & Au...
 
Serverless data processing with Data Pipeline
Serverless data processing with Data PipelineServerless data processing with Data Pipeline
Serverless data processing with Data Pipeline
 
Common issues with Apache Kafka® Producer
Common issues with Apache Kafka® ProducerCommon issues with Apache Kafka® Producer
Common issues with Apache Kafka® Producer
 
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Surati Tech Talks 2022 / Build reliable Svelte applications using CypressSurati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
 
WinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release PipelinesWinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release Pipelines
 
(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument
(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument
(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument
 
DevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating DeploymentsDevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating Deployments
 
CQRS + ES with Scala and Akka
CQRS + ES with Scala and AkkaCQRS + ES with Scala and Akka
CQRS + ES with Scala and Akka
 
Nordstrom Data Lab Recommendo API with Node.js
Nordstrom Data Lab Recommendo API with Node.jsNordstrom Data Lab Recommendo API with Node.js
Nordstrom Data Lab Recommendo API with Node.js
 
Azure App Services
Azure App ServicesAzure App Services
Azure App Services
 
Enterprise Beacon Object Hive - Siebel Version Control
Enterprise Beacon Object Hive - Siebel Version ControlEnterprise Beacon Object Hive - Siebel Version Control
Enterprise Beacon Object Hive - Siebel Version Control
 

Ähnlich wie Making the most out of CakePHP 2.2

Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanDay 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanAmazon Web Services
 
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...Harry McLaren
 
8 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 20188 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 2018Taswar Bhatti
 
Accelerating YourBusiness with Security
Accelerating YourBusiness with SecurityAccelerating YourBusiness with Security
Accelerating YourBusiness with SecurityAmazon Web Services
 
Cloud patterns at Carleton University
Cloud patterns at Carleton UniversityCloud patterns at Carleton University
Cloud patterns at Carleton UniversityTaswar Bhatti
 
Cloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsCloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsTaswar Bhatti
 
Accelerating your Business with Security
Accelerating your Business with SecurityAccelerating your Business with Security
Accelerating your Business with SecurityAmazon Web Services
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
ENT401 Deep Dive with Amazon EC2 Systems Manager
ENT401 Deep Dive with Amazon EC2 Systems ManagerENT401 Deep Dive with Amazon EC2 Systems Manager
ENT401 Deep Dive with Amazon EC2 Systems ManagerAmazon Web Services
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)Amazon Web Services
 
Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017Amazon Web Services
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...garrett honeycutt
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksAmazon Web Services
 
Server and application monitoring webinars [Applications Manager] - Part 4
Server and application monitoring webinars [Applications Manager] - Part 4Server and application monitoring webinars [Applications Manager] - Part 4
Server and application monitoring webinars [Applications Manager] - Part 4ManageEngine, Zoho Corporation
 
ENT302 Deep Dive on AWS Management Tools and New Launches
ENT302 Deep Dive on AWS Management Tools and New LaunchesENT302 Deep Dive on AWS Management Tools and New Launches
ENT302 Deep Dive on AWS Management Tools and New LaunchesAmazon Web Services
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsJoonas Westlin
 
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015Amazon Web Services Korea
 
Build, Test and Extend Integrated Workflows 3.7
Build, Test and Extend Integrated Workflows 3.7Build, Test and Extend Integrated Workflows 3.7
Build, Test and Extend Integrated Workflows 3.7StephenKardian
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applicationsGR8Conf
 

Ähnlich wie Making the most out of CakePHP 2.2 (20)

Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanDay 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
 
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...
Using Metrics for Fun, Developing with the KV Store + Javascript & News from ...
 
8 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 20188 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 2018
 
Accelerating YourBusiness with Security
Accelerating YourBusiness with SecurityAccelerating YourBusiness with Security
Accelerating YourBusiness with Security
 
Cloud patterns at Carleton University
Cloud patterns at Carleton UniversityCloud patterns at Carleton University
Cloud patterns at Carleton University
 
Cloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsCloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong Codeaholics
 
Accelerating your Business with Security
Accelerating your Business with SecurityAccelerating your Business with Security
Accelerating your Business with Security
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
CakePHP REST Plugin
CakePHP REST PluginCakePHP REST Plugin
CakePHP REST Plugin
 
ENT401 Deep Dive with Amazon EC2 Systems Manager
ENT401 Deep Dive with Amazon EC2 Systems ManagerENT401 Deep Dive with Amazon EC2 Systems Manager
ENT401 Deep Dive with Amazon EC2 Systems Manager
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
 
Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017Configuration Management in the Cloud | AWS Public Sector Summit 2017
Configuration Management in the Cloud | AWS Public Sector Summit 2017
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech Talks
 
Server and application monitoring webinars [Applications Manager] - Part 4
Server and application monitoring webinars [Applications Manager] - Part 4Server and application monitoring webinars [Applications Manager] - Part 4
Server and application monitoring webinars [Applications Manager] - Part 4
 
ENT302 Deep Dive on AWS Management Tools and New Launches
ENT302 Deep Dive on AWS Management Tools and New LaunchesENT302 Deep Dive on AWS Management Tools and New Launches
ENT302 Deep Dive on AWS Management Tools and New Launches
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable Functions
 
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
 
Build, Test and Extend Integrated Workflows 3.7
Build, Test and Extend Integrated Workflows 3.7Build, Test and Extend Integrated Workflows 3.7
Build, Test and Extend Integrated Workflows 3.7
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 

Mehr von José Lorenzo Rodríguez Urdaneta (7)

Agile database access with CakePHP 3
Agile database access with CakePHP 3Agile database access with CakePHP 3
Agile database access with CakePHP 3
 
Faster develoment with CakePHP 3
Faster develoment with CakePHP 3Faster develoment with CakePHP 3
Faster develoment with CakePHP 3
 
Advanced Querying with CakePHP 3
Advanced Querying with CakePHP 3Advanced Querying with CakePHP 3
Advanced Querying with CakePHP 3
 
CakeFest 2013 keynote
CakeFest 2013 keynoteCakeFest 2013 keynote
CakeFest 2013 keynote
 
CakePHP 3.0: Embracing the future
CakePHP 3.0: Embracing the futureCakePHP 3.0: Embracing the future
CakePHP 3.0: Embracing the future
 
ZeroMQ in PHP
ZeroMQ in PHPZeroMQ in PHP
ZeroMQ in PHP
 
Mongo Cake Plugin for CakePHP 2.0
Mongo Cake Plugin for CakePHP 2.0Mongo Cake Plugin for CakePHP 2.0
Mongo Cake Plugin for CakePHP 2.0
 

Kürzlich hochgeladen

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Kürzlich hochgeladen (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Making the most out of CakePHP 2.2

  • 2. PUBLISHER - SUBSCRIBERS • Made the code we had for behaviors, helpers, components, etc. into a reusable generic events system • Theidea is simple: an object publishes a named event with some data and an unknown list of listeners will get notified and have the chance of changing the outcome of the original operation
  • 3. SOME BUILT-IN EVENTS • Model.beforeValidate, Model.afterValidate, Model.beforeSave, Model.afterSave... • Controller.initialize, Controller.startup, Controller.beforeRender... • View.beforeRender, View.beforeLayout... • Dispatcher.beforeDispatch, Dispatcher.afterDispatch
  • 4. CREATE YOUR OWN EVENTS! •A Paypal plugin received a notification from payments server. What do you do? (You need to send emails, mark order s processed, decrement stock...) • Trigger a new Paypal.afterProcess event! • Any number of listeners can processes the rest of the actions for you while leaving the Paypal plugin free of any external concerns
  • 6. SUBSCRIPTION PATTERNS • Direct: during runtime an object attaches event listeners to another as needed • Configuration based: define a list or listeners. Read the list in the publisher class or factory when needed • Indirectglobal: Use the global event manager to attach indirectly to any event. • Conventionbased: load listeners for an object from a convention-defined location
  • 8. DISPATCHER FILTERS Let’s jump directly to examples :)
  • 11. SOME COOL IDEAS WITH FILTERS • Complete reverse proxy • Pluggable OAuth Authorization • Performance monitoring
  • 13. TYPES OF CACHE • Browser caches • Proxy caches • Gateway caches (or reverse proxy)
  • 14. HEADERS INVOLVED IN CACHING • Cache-Control - This it the most important one • Expires • ETag • Last-Modified
  • 15. MESSING WITH CACHE- CONTROL Proxies use shared cache, so setting a response as private will not be cached by default
  • 16. VALIDATION VS EXPIRATION • Expiration model: you specify for how long a response is valid, new requests will not be made until time expires • Validation: requests are made every time and server responds with either a 304 status or a new response.
  • 17. MESSING WITH EXPIRATION Using max-age and s-maxage is preferred because of several limitations in the Expire header
  • 18. VALIDATION MODEL If browser send If-Modified-Since header, then a 304 response will be issued and view rendering process will be skipped entirely
  • 19. CONDITIONAL VIEW RENDER Same as previous example, but automatic and awesome
  • 21. WHAT ARE THEY? •A declarative, static way of tagging cache entries with any string • Entries tagged with the same string can be invalidated all at the same time in an atomic way •A way to organize your cache entries into logical groups
  • 23. CACHE GROUPS FACTS • Clearingall entries under a groups will delete all entries for all Cache configurations having the same groups in them and sharing the same prefix. Even across engines! • Youcannot dynamically add new groups to cache configurations, you need to plan your strategy • You*could* dynamically create cache configs having exactly the groups you want to tag entries with, but it’s super hard
  • 25. WHAT FOR? • Some applications require dynamic validations rules depending on the action being executed • Directly modifying $validate property on the model can be tricky • Severalparts of CakePHP had to implement the same $validates parsing to extract information out of it
  • 26. WHAT CAN I DO WITH IT? • Dynamically inspect, add or remove validations rules for a model • Swap at runtime validation objects depending on your own logic • Create with an easy API complex validation systems