G
G
grabbee2020-09-01 04:35:57
symfony
grabbee, 2020-09-01 04:35:57

API_platform How to implement PurgerInterface?

In api_platform, you can write your own class for clearing the cache by implementing PurgerInterface

It seems that you can easily write it there. Only I do not understand where to connect this class further.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grabbee, 2020-09-02
@grabbee

You need to come up with only one method in your implementation - purge
Next, define the service

api_platform.http_cache.purger:
    class: App\Path\SomePurger

This will replace the preset one with yours

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question