We have a 3rd party caching solution where we cache our product page. This product page is also inherently using epi caching out of the box. We'd like to extend the amount of time we cache a product page in the 3rd part solution, however we need to ensure epi cache is cleared as well.
My question is, when we run a product import and a cached product is changed in any way is that cache invalidated right away or is it still going to wait for it's assigned expiration?
haven't changed the code, but it sounds logical to invalidate cache entry right away and not wait till the expiration, otherwise - old (cached) version is served
As long as you use the official interfaces for creating and updating the Commerce content nodes and entries, you should be safe.
I believe the internals take care of the invalidation of cached versions upon persisting updates. At least that’s my experience.
That’s the internal object caching. It sounds like you also do external output caching. If that’s the case you probably also need to communicate cache invalidation to that output cache.
As a rule of thumb we would like the caching of framework objects transparent for you, i.e. you don't have to invalidate the cache yourself, as long as you use the public APIs instead of underlying data access directly (which is usually a big no no)