Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache Rules output inconsistent #25

Open
AaronSeibert opened this issue Apr 12, 2024 · 0 comments
Open

Cache Rules output inconsistent #25

AaronSeibert opened this issue Apr 12, 2024 · 0 comments

Comments

@AaronSeibert
Copy link
Contributor

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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant