\Ceo\ServicesStaticViewService

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.

Summary

Methods
Properties
Constants
cacheViewForRoute()
linkRouteToContent()
getViewForRoute()
invalidateRoute()
invalidateUuid()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

cacheViewForRoute()

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

Cache full view for route

Parameters

string $view
string $route

Returns

boolean

linkRouteToContent()

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

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

Returns

boolean

getViewForRoute()

getViewForRoute(string  $route) : string

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

Parameters

string $route

Returns

string —

or boolean

invalidateRoute()

invalidateRoute(string  $route,   $isHashed = false) : boolean

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

Parameters

string $route
$isHashed

Returns

boolean

invalidateUuid()

invalidateUuid(string  $uuid) : boolean

Invalidate a uuid regardless of view timeout. Invaliding a UUID will invalidate ALL routes the UUID is associated with.

Parameters

string $uuid

Returns

boolean