$Web Expire: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Expire}}
{{DISPLAYTITLE:$Web_Expire}}
<span class="pageSubtitle"><section begin="desc" />Set expiration date/time of Web response<section end="desc" /></span>
<span class="pageSubtitle">Set expiration date/time of Web response</span>




Line 8: Line 8:


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /><span class="term">%rc</span> = $Web_Expire( exp_time )
<p class="syntax"><span class="term">%rc</span> = $Web_Expire( exp_time )
<section end="syntax" /></p>
</p>


===Syntax terms===
===Syntax terms===

Revision as of 14:55, 9 April 2013

Set expiration date/time of Web response


$Web_Expire sets the expiration date and time for the Web Server response entity being returned by the application. Using $Web_Expire, you can control how long a browser caches an entity returned by your application.

$Web_Expire requires one argument and returns a numeric status code. It is also callable.

Syntax

%rc = $Web_Expire( exp_time )

Syntax terms

exp_time A date/time expressed in seconds since 12 AM on January 1, 1900. You can use the $Web_Datens function to get the current date in this format, and manipulate it using standard User Language expressions.

Return codes

Code Meaning
0 Completed successfully
-1 Not a web thread
-4 Invalid datetime value

Examples

Use $Web_Expire to control how long a browser caches an entity returned by your application.

* Get current date in binary %X = $WEB_DATENS * Add one week to the current date %X = %X + 7*24*60*60 * Ensure browser doesn't cache returned data * longer than one week %RC = $Web_Expire( %X ) * Changed my mind, only cache URL for 1 hour. * The previous $Web_Expire call is forgotten. %X = %X - (7*24-1)*60*60 %RC = $Web_Expire( %X )

In the above example, $Web_Expire is called to set the expiration date for the response entity. A second $Web_Expire demonstrates that you can override the $Web_Expire value any time you wish.

See also