Up until now, using the MemoryCache "cache backend" was a bit inconvenient because it could not be declared like any other cache backend due to the lack of a cache factory. In short, this is because MemoryCache is not a real cache backend as it returns a shared object across multiple gets.
To improve DX, but also keep a clear distinction between "real" cache backends and MemoryCache, a new service tag of cache.bin.memory has been added to core alongside a MemoryCacheFactory with service ID cache.backend.memory.memory.
You may now add a MemoryCache to your module like shown below and it will have its cache tags properly invalidated as you would expect of any regular cache backend.
cache.jsonapi_memory:
class: Drupal\Core\Cache\MemoryCache\MemoryCacheInterface
tags:
- { name: cache.bin.memory, default_backend: cache.backend.memory.memory }
factory: ['@cache_factory', 'get']
arguments: [jsonapi_memory]
There is also a new Cache::getMemoryBins() to get a list of all memory cache services.