255 OWA_CACHE
The OWA_CACHE package provides an interface that enables the PL/SQL Gateway cache to improve the performance of PL/SQL Web applications.
See Also:
For more information about implementation of this package:
The chapter contains the following topics:
255.1 OWA_CACHE Constants
OWA_CACHE defines several constants to use when specifying parameter values.
-
system_levelCONSTANTVARCHAR(6):='SYSTEM'; -
user_levelCONSTANTVARCHAR(4):='USER';
255.2 Summary of OWA_CACHE Subprograms
This table lists the OWA_CACHE subprograms and briefly describes them.
Table 255-1 OWA_CACHE Package Subprograms
| Subprogram | Description |
|---|---|
|
Disables the cache for this particular request |
|
|
Returns the tag associated with the cached content (used in the Validation technique model only) |
|
|
Returns the caching level (used in the Validation technique model only) |
|
|
Sets up the cache headers for validation model cache type |
|
|
Sets up the cache headers for expires model cache type |
|
|
Sets up the headers for a not modified cache hit (used in the Validation technique model only) |
|
|
Sets up the headers for a surrogate-control header for Web cache |
255.2.1 DISABLE Procedure
This procedure disables the cache for this particular request.
Syntax
OWA_CACHE.DISABLE;
255.2.2 GET_ETAG Function
This function returns the tag associated with the cached content. It is used in the Validation technique only.
Syntax
OWA_CACHE.GET_ETAG RETURN VARCHAR2;
Return Values
The tag for cache hit, otherwise NULL.
255.2.3 GET_LEVEL Function
This returns the caching level. It is used in the Validation technique model only.
Syntax
OWA_CACHE.GET_LEVEL RETURN VARCHAR2;
Return Values
The caching level string ('USER' or 'SYSTEM') for cache hit, otherwise NULL.
255.2.4 SET_CACHE Procedure
This procedure sets up the cache headers for validation model cache type.
Syntax
OWA_CACHE.SET_CACHE( p_etag IN VARCHAR2, p_level IN VARCHAR2);
Parameters
Table 255-2 SET_CACHE Procedure Parameters
| Parameter | Description |
|---|---|
|
|
The |
|
|
The caching level (' |
Exceptions
VALUE_ERROR is thrown if
-
p_etagis greater than 55 -
p_levelis not 'USER' or 'SYSTEM'
255.2.5 SET_EXPIRES Procedure
This procedure sets up the cache headers for expires model cache type.
Syntax
OWA_CACHE.SET_EXPIRES( p_expires IN NUMBER, p_level IN VARCHAR2);
Parameters
Table 255-3 SET_EXPIRES Procedure Parameters
| Parameter | Description |
|---|---|
|
|
The number of minutes this content is valid. |
|
|
The caching level (' |
Exceptions
VALUE_ERROR is thrown if
-
p_expiresis negative or zero -
p_levelis not 'USER' or 'SYSTEM' -
p_expiresis > 525600 (1 year)
255.2.6 SET_NOT_MODIFIED Procedure
This procedure sets up the headers for a not-modified cache hit. It is used in the Validation technique only.
Syntax
OWA_CACHE.SET_NOT_MODIFIED;
Exceptions
VALUE_ERROR is thrown if If the etag was not passed in
255.2.7 SET_SURROGATE_CONTROL Procedure
This procedure sets the headers for a surrogate-control header for Web cache
Syntax
OWA_CACHE.SET_SURROGATE_CONTROL( p_value IN VARCHAR2);
Parameters
Table 255-4 SET_SURROGATE_CONTROL Procedure Parameters
| Parameter | Description |
|---|---|
|
|
The value to be passed as the Surrogate-Control header. |
Exceptions
VALUE_ERROR is thrown if If p_value is greater than 55 in length.