
Cache & Performance
Cache pools, adapters, tags, cache invalidation, HTTP cache, ESI, Varnish integration
1Which interface does Symfony use to implement the PSR-6 cache system?
Which interface does Symfony use to implement the PSR-6 cache system?
Resposta
Symfony implements the PSR-6 standard through the CacheItemPoolInterface. This interface defines methods getItem(), hasItem(), deleteItem(), save() and clear() for managing cache items. Symfony's Cache component provides several adapters (Redis, Memcached, Filesystem, etc.) that all implement this interface, ensuring interoperability with other PSR-6 compatible PHP libraries.
2What is the default cache adapter configured in Symfony for the development environment?
What is the default cache adapter configured in Symfony for the development environment?
Resposta
In development environment, Symfony uses the ArrayAdapter by default which stores cache in memory. This cache is not persistent between requests, which is ideal for development as it avoids stale cache issues when modifying code. In production, it is recommended to use a persistent adapter like Redis or Memcached for better performance.
3How to create a custom cache pool in Symfony configuration?
How to create a custom cache pool in Symfony configuration?
Resposta
Custom cache pools are defined under the framework.cache.pools key in configuration. Each pool can specify its adapter, default lifetime (default_lifetime), and optionally tags. For example, a 'app.cache.products' pool with RedisAdapter allows managing product cache independently from other data, facilitating targeted invalidation.
Which method to use to retrieve a value from cache with a computation callback if missing?
What is the main advantage of cache tags in Symfony?
+17 perguntas de entrevista
Outros temas de entrevista Symfony
Modern PHP (8.1+)
Symfony Basics
Routing & Controllers
Twig & Templates
Doctrine ORM Basics
Symfony Forms
Data Validation
Dependency Injection & Services
Security & Authentication
Doctrine Advanced
API Platform
Serializer Component
Events & Event Subscribers
Console & Commands
Messenger Component
HTTP Client
Workflow Component
Testing Symfony
Mailer Component
Translations & i18n
EasyAdmin Bundle
Symfony Architecture
Performance & Optimization
Security Advanced
Custom Bundles
Microservices with Symfony
Real-time & WebSockets
Deployment & DevOps
Domine Symfony para sua proxima entrevista
Acesse todas as perguntas, flashcards, testes tecnicos, exercicios de code review e simuladores de entrevista.
Comece gratis