Cache
class Cache (View source)
Methods
Create a cache instance by route path
Check if is HEAD or GET, you can overwrite this method
Write cache
Check HTTP_IF_MODIFIED_SINCE and HTTP_IF_NONE_MATCH from server
If true you can send 304 Not Modified
Checks if page (from route) is already cached.
Write data in cache file.
Show cache content from current page (from route) in output
Details
void
__construct(int $expires = 900, int $modified = 0, string $prefix = '', bool $querystring = false)
Create a cache instance by route path
static protected bool
allow()
Check if is HEAD or GET, you can overwrite this method
void
finish()
Write cache
static bool
match(string $modified, string $etag = null)
Check HTTP_IF_MODIFIED_SINCE and HTTP_IF_NONE_MATCH from server
If true you can send 304 Not Modified
bool
cached()
Checks if page (from route) is already cached.
string
write(string $data)
Write data in cache file.
This method returns the set value itself because the class uses ob_start
void
show()
Show cache content from current page (from route) in output