Skip to main content

Expires

property Expires: TDateTime read;

Example

procedure ScriptEvent(var Value: variant);
begin
if (Request <> nil) and (Request.Expires >= 0) then
Value := Request.Expires
else
Value := 0;
end;

Usage

Parses the first Expires request-header value, returning -1 when absent even though current Expires semantics concern responses.

Additional Technical Info

Expires looks up the first inbound Expires field and uses the same bridge parser as Date. Empty returns -1; invalid nonempty syntax can raise. Standard weekday-leading HTTP-date text becomes a timezone-free TDateTime representing UTC, while numeric-leading legacy forms follow WebBroker's older parser without timezone conversion.

Current HTTP defines Expires as response metadata used to calculate freshness. Its presence on a request does not make the request expire, configure a Velox cache, set an action timeout or authorise processing. Treat this request-side property as legacy/untrusted metadata unless a documented application protocol assigns it a separate meaning.

Do not compare directly without first distinguishing the -1 sentinel and deciding the timezone convention. For a real request deadline, define a signed field and explicit skew/replay policy, or enforce server-side timeouts independent of caller data. A remote caller can choose this value.

Test Request for nil. Reading the property has no cache or response side effect.

External references

Created 2026-07-15