putyourlightson / craft-blitz

Intelligent static page caching for creating lightning-fast sites with Craft CMS.
https://putyourlightson.com/plugins/blitz
Other
149 stars 36 forks source link

Refresh Cached URLs via URL and API key does not support wildcard for CloudFront #500

Closed dillonbailey closed 1 year ago

dillonbailey commented 1 year ago

example failing URL: https://example.ddev.site/actions/blitz/cache/refresh-urls?key=SuperSecret&urls=https%3A//example.ddev.site/api/*

bencroker commented 1 year ago
  1. Invalidation error logged to console in blitz.log

Can you please share the error message?

dillonbailey commented 1 year ago
Screenshot 2023-04-21 at 10 40 07 am
bencroker commented 1 year ago

It looks like AWS is complaining that your URL is an invalid path. Can you share the URL you are refreshing, with the domain redacted if necessary?

dillonbailey commented 1 year ago

Yeah this is the gist: https://example.ddev.site/actions/blitz/cache/refresh-urls?key=SuperSecret&urls=https%3A//example.ddev.site/api/*

I've tested all variations of url encoding the * at the end but that seems to be the issue. If you entered this directly in the AWS console it would work correctly, I've not tried direct via SDK to validate.

bencroker commented 1 year ago

Can you apply the code change from https://github.com/putyourlightson/craft-blitz-cloudfront/commit/4d4572cc2feba08ef77227d56ae9aa9ef6bb1523, which will log the paths that cause the error, so we can troubleshoot what AWS is complaining about?

bencroker commented 1 year ago

Any update on this @dillonbailey?

bencroker commented 1 year ago

Closing due to inactivity.