PHP Training – Performance and Caching

Level

Advanced

Duration

16h / 2 days

Date

Individually arranged

Price

Individually arranged

PHP Training – Performance and Caching

This workshop teaches a systematic approach to performance optimization — not guessing, but measuring. Participants work with a functioning e-commerce application containing intentionally introduced performance issues and improve it step by step: profiling the code, fixing N+1 queries, implementing caching at three levels (application, HTTP, and infrastructure), and building a read model optimized for data retrieval. Every optimization starts with a measurement and ends with another measurement — participants work with concrete numbers rather than abstract promises. The workshop concludes with an application demonstrating measurable performance improvements and a comprehensive toolkit for diagnosing performance issues in production.

Who is this training for?
  • logo infoshare Graduates of the PHP training path (Advanced or Architecture) who want to deepen their knowledge of performance optimizationof the PHP Fundamentals + Advanced workshop who are ready to move to an architectural level
  • logo infoshare PHP developers working with applications that “work, but are slow”
  • logo infoshare Developers who want to learn how to profile and implement caching instead of guessing what is slowworking with monoliths where “a change in one place breaks three others”participants who want to learn how to build web applications using PHP or organize and enhance their existing skills
  • logo infoshare Teams responsible for the performance of production PHP applications

Requirements

  • PHP 8.3+: layered architecture, services, repositories
  • PHPUnit testing: unit and integration tests
  • MySQL: SQL queries, PDO or Doctrine DBAL
  • Docker and Composer

What will you learn?

  • Profiling PHP applications with the Xdebug profiler — finding bottlenecks instead of guessing
  • Identifying and fixing N+1 queries — one of the most common performance issues in PHP applications
  • SQL query optimization — EXPLAIN ANALYZE, indexes, and selective denormalization
  • Application-level caching — Symfony Cache / PSR-6, with Redis as a backend
  • Cache invalidation strategies — TTL, tag-based, and event-driven invalidation
  • HTTP caching — Cache-Control, ETag, Last-Modified, and the reverse proxy concept
  • Read models — denormalizing data for efficient reads and synchronizing them through domain events

Training Program

Day 1

 

Stage 1: Profiling — Find the Bottleneck

  • Xdebug profiler — configuration and profile generation
  • Reading profiles — identifying hot paths and the slowest execution paths
  • Database metrics — EXPLAIN ANALYZE and slow query log
  • Benchmarking — measuring response times and establishing a baseline for comparison

Outcome: Participants have a baseline of performance metrics and know where the bottlenecks are.

 

Stage 2: Query Optimization

  • N+1 queries — identifying the problem in Doctrine DBAL (a query inside a loop), batch loading
  • Indexes — when they help, when they do not, and composite indexes
  • Query optimization — rewriting slow queries and applying selective denormalization
  • Measuring after optimization — comparing results against the baseline

Outcome: The most common database performance issues are identified and fixed with measurable improvements.

 

Day 2

 

Stage 3: Caching Strategies

Application-level caching:

  • Symfony Cache / PSR-6 — configuration and adapters (filesystem, Redis)
  • Cache patterns — cache-aside, read-through
  • Identifying hot data vs. cold data
  • Hands-on: caching product listings and catalog data

Cache invalidation:

  • TTL — simple, but potentially risky due to stale data
  • Tag-based invalidation — Symfony Cache tags
  • Event-driven invalidation — invalidating the cache in response to domain events

HTTP caching:

  • Cache-Control, ETag, Last-Modified — HTTP headers
  • Reverse proxy concept (Varnish/Nginx) — configuring Cache-Control in Symfony Response
  • CDN — when and what to delegate

Outcome: The application uses caching at three levels, with correctly implemented invalidation.

 

Stage 4: Read Model and Summary

  • Read model — denormalizing data for efficient reads
  • When a read model makes sense — heavy reads vs. light reads
  • Implementation — a separate table optimized for listings
  • Synchronizing the read model through domain events
  • Final measurement — comparing results with the baseline established in Stage 1
  • Retrospective — what had the biggest impact and what turned out to be over-engineering

Outcome: Participants leave with a comprehensive toolkit for diagnosing and fixing performance issues.

Contact us

we will organize training for you tailored to your needs

Przemysław Wołosz

Key Account Manager

przemyslaw.wolosz@infoShareAcademy.com

    The controller of your personal data is InfoShare Academy Sp. z o.o. with its registered office in Gdańsk, al. Grunwaldzka 427B, 80-309 Gdańsk, KRS: 0000531749, NIP: 5842742213. Personal data are processed in accordance with information clause.