Class rex_response

HTTP1.1 Client Cache Features.

Package: redaxo\core
Located at redaxo/src/core/lib/response.php

Methods summary

public static
# setStatus( integer $httpStatus )

Sets the HTTP Status code.

public static string
# getStatus( )

Returns the HTTP Status code.

public static
# setHeader( string $name, string $value )

Set a http response header. A existing header with the same name will be overridden.

public static
# preload( string $file, string $type, string $mimeType )

Set a file to be preload via http link header.

public static
# sendRedirect( string $url )

Redirects to a URL.

public static
# sendFile( string $file, string $contentType, string $contentDisposition = 'inline', null|string $filename = null )

Sends a file to client.

public static
# sendResource( string $content, null|string $contentType = null, null|integer $lastModified = null, null|string $etag = null, null|string $contentDisposition = null, null|string $filename = null )

Sends a resource to the client.

public static
# sendPage( string $content, integer $lastModified = null )

Sends a page to client.

public static
# sendContent( string $content, string $contentType = null, integer $lastModified = null, string $etag = null )

Sends content to the client.

public static
# cleanOutputBuffers( )

Cleans all output buffers.

public static
# sendContentType( string $contentType = null )

Sends the content type header.

public static
# sendCacheControl( mixed $cacheControl = 'must-revalidate, proxy-revalidate, private, no-cache, max-age=0' )

Sends the cache control header.

public static
# sendLastModified( integer $lastModified = null )

Checks if content has changed by the last modified timestamp.

public static
# sendEtag( string $cacheKey )

Checks if content has changed by the etag cachekey.

protected static string
# sendGzip( string $content )

Encodes the content with GZIP/X-GZIP if the browser supports one of them.

public static
# sendCookie( string $name, string|null $value, array $options = [] )
public static

Constants summary

string HTTP_OK
#'200 OK'
string HTTP_PARTIAL_CONTENT
#'206 Partial Content'
string HTTP_MOVED_PERMANENTLY
#'301 Moved Permanently'
string HTTP_NOT_MODIFIED
#'304 Not Modified'
string HTTP_MOVED_TEMPORARILY
#'307 Temporary Redirect'
string HTTP_NOT_FOUND
#'404 Not Found'
string HTTP_FORBIDDEN
#'403 Forbidden'
string HTTP_UNAUTHORIZED
#'401 Unauthorized'
string HTTP_RANGE_NOT_SATISFIABLE
#'416 Range Not Satisfiable'
string HTTP_INTERNAL_ERROR
#'500 Internal Server Error'
string HTTP_SERVICE_UNAVAILABLE
#'503 Service Unavailable'