StaticViewService
class StaticViewService extends BaseService
The StaticViewService is responsible for managing the storage and invalidation of static views. It is the core of CEO's dynamically-static (statically-dynamic?) caching system.
In order for the system to know what is cached with what view there are two components to watch for:
StaticViewService::cacheViewForRoute
StaticViewService::linkRouteToContent
The first links a full view output to a route. The second links a route to a UUID. Knowing both, the system can properly invalidate cached views whenever content is updated.
Methods
Cache full view for route
Link a route to a UUID.
Fetch view for given route. Will return false if route does not exist or cache has timed out.
Invalidate a route regardless of timeout. Invaliding a route will force it to regenerate at the next request.
Invalidate a uuid regardless of view timeout. Invaliding a UUID will invalidate ALL routes the UUID is associated with.
Details
at line 28
boolean
cacheViewForRoute(string $view, string $route = false)
Cache full view for route
at line 73
boolean
linkRouteToContent(string $uuid, string $route = false)
Link a route to a UUID.
Keep in mind these are written as a transaction at the end of the request to limit overwrites.
at line 110
string
getViewForRoute(string $route)
Fetch view for given route. Will return false if route does not exist or cache has timed out.
at line 148
boolean
invalidateRoute($route, $isHashed = false)
Invalidate a route regardless of timeout. Invaliding a route will force it to regenerate at the next request.
at line 174
boolean
invalidateUuid(string $uuid)
Invalidate a uuid regardless of view timeout. Invaliding a UUID will invalidate ALL routes the UUID is associated with.