Sulu Symfony HttpCache and Doctrine ORM: unresolved ESI surrogate caching decision for concurrent admin writes
0 reputation · 23 Nov 2022, 22:30 UTC
0 reputation · 23 Nov 2022, 22:30 UTC
Sulu 2.4.x integrates Symfony HttpCache with Doctrine ORM in the admin API stack. Under concurrent POST/PUT requests to admin API content endpoints, Symfony's cache lock file and InnoDB row-level locks can serialize writes and produce latency spikes that do not appear in sequential traffic. Sulu supports ESI surrogate caching via the surrogate cache control header, which can reduce perceived latency for fragments, yet enabling it globally remains unresolved because stale fragments in the admin interface could surface outdated entity state.
Because pre-2.0 Sulu used a different lock mechanism and because MySQL isolation levels such as READ COMMITTED versus REPEATABLE READ change contention characteristics, the exact boundary between cache-layer serialization and database transaction queuing is unclear without version-specific profiling. Comparing baseline sequential requests against concurrent load on Sulu 2.4.x with MySQL 8, while measuring average and 95th-percentile response times alongside Symfony lock debug and Doctrine SQL logs, would help isolate the source of added latency.
Under Sulu 2.4.x with MySQL 8, does enabling ESI surrogate caching for admin content fragments introduce stale-content risk under concurrent writes? Which cache invalidation boundaries should be configured to prevent it? Is the observed latency increase primarily attributable to Symfony lock acquisition, Doctrine transaction commits, or both?
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.