Web API Reference Guide > Available API Methods > Page Cache Methods > The pagecacheSaveRule Method

The pagecacheSaveRule Method

Creates or updates a page cache rule.

Version: 1.3

Required Permissions: Full

HTTP method: POST

Supported by Editions: Zend Server

Request Parameters:  

Parameter

 Type

Required

Description

ruleId

integer

No

Required when updating an existing rule

urlScheme

string

Yes

'http', 'https' or 'https?' for all

urlHost

string

Yes

 

urlPath

string

Yes

 

matchType

string

Yes

'exactMatch', 'regexMatch' or 'regexlMatch'

lifetime

integer

Yes

 

compress

boolean

No

Default TRUE

name

string

No

Non empty string

conditionsType

array

No

'and' or 'or'

conditions

array

No

 

splitBy

array

No

 

Expected Response Code: 200 OK. For more information see Response Format.

Response Format: The rule information.

Possible Action Specific Error Codes:

HTTP Code

Error Code

Description

500

internalServerError

Creation of rule failed due to an internal problem

Example

Usage Example

Request

GET/ZendServer/Api/pagecacheSaveRule

urlScheme=http&urlHost=myHost&urlPath=index.php&lifetime=360

Response

<?xml version="1.0" encoding="UTF-8"?>

<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.3">

<requestData>

<apiKeyName><![CDATA[Admin]]></apiKeyName>

<method>pagecacheSaveRule</method>

</requestData>

<responseData>

<ruleInfo>

<rule>

<ruleId>1</ruleId>

<urlScheme>http</urlScheme>

<urlHost>localhost</urlHost>

<urlPath>index.php</urlPath>

<type>exact_match</type>

<application></application>

<applicationId>-1</applicationId>

<name></name>

</rule>

<ruleData>

<ruleId>1</ruleId>

<conditionsType>and</conditionsType>

<conditions></conditions>

<splitby></splitby>

<lifetime>360</lifetime>

<compress>yes</compress>

</ruleData>

</ruleInfo>

</responseData>

</zendServerAPIResponse>

 

Read Also

  Available API Methods    
  Page Cache Methods