Move the invalidateFrontendCache function to the service
This allows us to call this non statically.
I also deprecated the old invalidateFrontendCache in favor of the new one