Skip to content

Releases: MFYDev/Ghost-BunnyCDN-Cache-Clearer

v1.1.1

28 Aug 20:24
Compare
Choose a tag to compare

Enhancement

  1. Error Handling: The optimized version introduces a centralized handleError function, which improves consistency in error reporting and reduces code duplication.

  2. Structured Logging: A log function was added to standardize logging across the application, making it easier to track and filter log messages.

  3. Code Modularization: The optimized version breaks down the code into smaller, more focused functions. This improves readability and maintainability.

  4. Async/Await Consistency: The new version uses async/await syntax more consistently throughout the code, which can lead to better readability and error handling.

  5. Parallel Processing: The cleanupPermaCacheFolders function now uses Promise.all for concurrent deletion of folders, potentially improving performance.

  6. Constants: HTTP status codes are now defined as constants, improving code readability and reducing the chance of errors.

  7. Environment Variable Validation: The check for required environment variables has been moved to a separate function, making the main handleRequest function cleaner.

  8. Simplified Main Handler: The handleRequest function in the optimized version is more streamlined, with much of the logic moved to separate functions.

These optimizations aim to improve the code's efficiency, readability, and maintainability while retaining all the original functionality. The core operations (Ghost webhook verification, BunnyCDN cache purging, and Perma-Cache cleanup) remain intact, but are now organized in a more structured and efficient manner.

v1.1.0

06 Jul 06:58
19d941c
Compare
Choose a tag to compare

Update the signature verification process to in line with Ghost's upgrade

According to the Ghost changelog and pull request: TryGhost/Ghost#20500

Ghost's change to include the timestamp in the signature hash is indeed a breaking change that requires me to update the verifySignature function in the Cloudflare Worker. Modify the function to accommodate this new signature format.

v1.0.0

27 Jun 19:14
Compare
Choose a tag to compare