You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/performance.md
+43Lines changed: 43 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,49 @@ distribution of API Platform, so this feature works out of the box.
26
26
Integration with Varnish and the Doctrine ORM is shipped with the core library. You can easily implement the support for
27
27
any other proxy or persistence system.
28
28
29
+
### Extending Cache-Tags for invalidation
30
+
31
+
Sometimes you need individual resources like `/me`. To work properly with Varnish, the cache tags need to be augmented with these resources. Here is an example how this can be done:
32
+
33
+
```php
34
+
<?php
35
+
36
+
declare(strict_types=1);
37
+
38
+
namespace AppBundle\EventSubscriber;
39
+
40
+
use ApiPlatform\Core\EventListener\EventPriorities;
41
+
use AppBundle\Entity\User;
42
+
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
43
+
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
44
+
use Symfony\Component\HttpKernel\KernelEvents;
45
+
46
+
final class UserResourcesSubscriber implements EventSubscriberInterface
0 commit comments