Skip to content

Cache Rules output inconsistent #25

Description

@AaronSeibert

The cache list-cache-settings-rule operation returns inconsistent structure when cache rules are defined vs when they are not:

Cache Rules Exist

[
    {
        "action": "HTTP_CACHE_MAKE_STATIC",
        "disabledByCacheMode": false,
        "enabled": true,
        "filter": "URL == \"/commons-9a37b461e14cdb912bf2.js\"",
        "name": "Force cache",
        "rule_id": 106200,
        "ttl": 3600
    }
]

No Cache Rules

{
    "debug_info": {
        "Site has no Cache rules": "GET - /api/prov/v2/sites/***/settings/cache/rules/",
        "id-info": "999999"
    },
    "res": 0,
    "res_message": "OK"
}

Scripts can currently check for the existence of the debug_info key to determine if there are existing rules or not - however, if we restructure the output like the example below, the check for debug_info could be eliminated and we'd have a consistent output.

{
    "rules" : [],
    "debug_info": {
        "Site has no Cache rules": "GET - /api/prov/v2/sites/***/settings/cache/rules/",
        "id-info": "999999"
    },
    "res": 0,
    "res_message": "OK"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions