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

boolean
cacheViewForRoute(string $view, string $route = false)

Cache full view for route

boolean
linkRouteToContent(string $uuid, string $route = false)

Link a route to a UUID.

string
getViewForRoute(string $route)

Fetch view for given route. Will return false if route does not exist or cache has timed out.

boolean
invalidateRoute($route, $isHashed = false)

Invalidate a route regardless of timeout. Invaliding a route will force it to regenerate at the next request.

boolean
invalidateUuid(string $uuid)

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

Parameters

string $view
string $route

Return Value

boolean

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.

Parameters

string $uuid
string $route

Return Value

boolean

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.

Parameters

string $route

Return Value

string or boolean

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.

Parameters

$route
$isHashed

Return Value

boolean

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.

Parameters

string $uuid

Return Value

boolean