Our REST web service and front-end are both on the Laravel Framework. The REST service and the front-end share a memcached server. The endpoint response and the data received on the front-end are cached. I don't want to use expiry and prefer clearing it when new data is added.
When new data is added to the back-end, Cache::flush()
is called upon saving to DB to clear the cached responses of the endpoints.
Then to clear the cache of the front-end, Cache::forget('front-end-cache-key')
is called.
Is there any way to improve on the solution above?