PAGE Methods
Including templates and objects
content(), module(), object()Request content via AJAX
collect(), complete(), elements(), element()Insert code (CSS, JS, HTML)
style(), script(), meta(), bottom(), tracking()Template data
directory(), views(), details(), preview(), charset(), language(), error()Reading and writing META data
title(), topic(), descr(), claim(), robots(), keywords()HTTP header
mime(), status(), expires(), header(), download()
expires()
Set current page's cache-control and last-modified datetime.
bool expires([ int hours ])
Return
TRUE if expiry date lies in the future
Parameter
Description
hoursBrowser cache-control setting (= hours from now). If you put a value <= 0 the page will not be cached by the browser.
No browser caching
$PAGE->expires(0)
RETURN: 'Expires: Fri, 19 Aug 2022 16:29:29 GMT;
Cache-Control: no-store;
Last-Modified: Fri, 19 Aug 2022 17:29:29 GMT;'
Activate browser caching
$PAGE->expires(8)
RETURN: 'Expires: Sat, 20 Aug 2022 00:00:00 GMT;
Cache-Control: public, max-age=28800;
Last-Modified: Fri, 19 Aug 2022 16:00:00 GMT;'