[TT-11585] Process DeleteAPICache event#6190
Conversation
|
API Changes --- prev.txt 2024-03-28 07:41:49.413689647 +0000
+++ current.txt 2024-03-28 07:41:46.569678191 +0000
@@ -8577,7 +8577,11 @@
NoticeGatewayDRLNotification NotificationCommand = "NoticeGatewayDRLNotification"
KeySpaceUpdateNotification NotificationCommand = "KeySpaceUpdateNotification"
OAuthPurgeLapsedTokens NotificationCommand = "OAuthPurgeLapsedTokens"
+ // NoticeDeleteAPICache is the command with which event is emitted from dashboard to invalidate cache for an API.
+ NoticeDeleteAPICache NotificationCommand = "DeleteAPICache"
)
+func (n NotificationCommand) String() string
+
type OASSchemaResponse struct {
Status string `json:"status"`
Message string `json:"message"` |
|
PR Description updated to latest commit (57a6afa) |
PR Review
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
57a6afa to
ce33ffc
Compare
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
dc33a3a to
17507ab
Compare
titpetric
left a comment
There was a problem hiding this comment.
LGTM, no more feedback
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
b5d091a to
3a34a70
Compare
|
|
/release to release-5.3 |
|
/release-5-lts |
|
Working on it! Note that it can take a few minutes. |
|
@jeffy-mathew Sorry, but I do not understand! |
## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description This PR adds * A redis event handler to react on event `DeleteAPICache`, this is used when gateway is used in pro mode. * A processor in edge gateways to invalidate cache via `DeleteAPICache` action via mdcb RPC. ## Related Issue https://tyktech.atlassian.net/browse/TT-11585 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ ## **Type** enhancement, bug_fix ___ ## **Description** - Introduced a new method `invalidateAPICache` to centralize the logic for API cache invalidation. - Added handling for a new signal `NoticeDeleteAPICache` to trigger the cache invalidation process. - Created tests to ensure the functionality of the new cache invalidation method. - Updated key space change processing to include the `DeleteAPICache` action. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>api.go</strong><dd><code>Refactor API Cache Invalidation Logic</code> </dd></summary> <hr> gateway/api.go <li>Refactored cache invalidation logic into a separate method <br><code>invalidateAPICache</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-644cda3aeb4ac7f325359e85fcddb810f100dd5e6fa480b0d9f9363a743c4e05">+1/-5</a> </td> </tr> <tr> <td> <details> <summary><strong>delete_api_cache.go</strong><dd><code>Introduce Method for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache.go <li>Introduced a new method <code>invalidateAPICache</code> to encapsulate the cache <br>invalidation logic. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8606dab58155ef5aab8c6f3364c0c6cdab44cad70addd3cc427bbeb99d412de7">+10/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>redis_signals.go</strong><dd><code>Handle Delete API Cache Signal</code> </dd></summary> <hr> gateway/redis_signals.go <li>Added handling for <code>NoticeDeleteAPICache</code> signal to trigger cache <br>invalidation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-18cb136722c238e19b02741a85510dfd464343f85365482f0873aa60a37718af">+5/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_storage_handler.go</strong><dd><code>Process DeleteAPICache Action in Key Space Changes</code> </dd></summary> <hr> gateway/rpc_storage_handler.go <li>Added <code>DeleteAPICache</code> to the list of actions to process for key space <br>changes. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8875f75b602664c44b62b67a4da41d748124ad270573a44db4ec977ee5d68021">+4/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>delete_api_cache_test.go</strong><dd><code>Add Tests for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache_test.go - Added tests for the new `invalidateAPICache` method. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-bf04614dddae2c523c9030b8571e35816c01d916f0023b3b66f2e45f84c528bf">+34/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions (cherry picked from commit 43f5f5c)
|
@jeffy-mathew Succesfully merged PR |
[TT-11585] Process DeleteAPICache event (#6190) ## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description This PR adds * A redis event handler to react on event `DeleteAPICache`, this is used when gateway is used in pro mode. * A processor in edge gateways to invalidate cache via `DeleteAPICache` action via mdcb RPC. ## Related Issue https://tyktech.atlassian.net/browse/TT-11585 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ ## **Type** enhancement, bug_fix ___ ## **Description** - Introduced a new method `invalidateAPICache` to centralize the logic for API cache invalidation. - Added handling for a new signal `NoticeDeleteAPICache` to trigger the cache invalidation process. - Created tests to ensure the functionality of the new cache invalidation method. - Updated key space change processing to include the `DeleteAPICache` action. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>api.go</strong><dd><code>Refactor API Cache Invalidation Logic</code> </dd></summary> <hr> gateway/api.go <li>Refactored cache invalidation logic into a separate method <br><code>invalidateAPICache</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-644cda3aeb4ac7f325359e85fcddb810f100dd5e6fa480b0d9f9363a743c4e05">+1/-5</a> </td> </tr> <tr> <td> <details> <summary><strong>delete_api_cache.go</strong><dd><code>Introduce Method for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache.go <li>Introduced a new method <code>invalidateAPICache</code> to encapsulate the cache <br>invalidation logic. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8606dab58155ef5aab8c6f3364c0c6cdab44cad70addd3cc427bbeb99d412de7">+10/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>redis_signals.go</strong><dd><code>Handle Delete API Cache Signal</code> </dd></summary> <hr> gateway/redis_signals.go <li>Added handling for <code>NoticeDeleteAPICache</code> signal to trigger cache <br>invalidation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-18cb136722c238e19b02741a85510dfd464343f85365482f0873aa60a37718af">+5/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_storage_handler.go</strong><dd><code>Process DeleteAPICache Action in Key Space Changes</code> </dd></summary> <hr> gateway/rpc_storage_handler.go <li>Added <code>DeleteAPICache</code> to the list of actions to process for key space <br>changes. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8875f75b602664c44b62b67a4da41d748124ad270573a44db4ec977ee5d68021">+4/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>delete_api_cache_test.go</strong><dd><code>Add Tests for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache_test.go - Added tests for the new `invalidateAPICache` method. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-bf04614dddae2c523c9030b8571e35816c01d916f0023b3b66f2e45f84c528bf">+34/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions
|
/release to release-5-lts |
|
Working on it! Note that it can take a few minutes. |
<!-- Provide a general summary of your changes in the Title above --> This PR adds * A redis event handler to react on event `DeleteAPICache`, this is used when gateway is used in pro mode. * A processor in edge gateways to invalidate cache via `DeleteAPICache` action via mdcb RPC. https://tyktech.atlassian.net/browse/TT-11585 <!-- Why is this change required? What problem does it solve? --> <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ enhancement, bug_fix ___ - Introduced a new method `invalidateAPICache` to centralize the logic for API cache invalidation. - Added handling for a new signal `NoticeDeleteAPICache` to trigger the cache invalidation process. - Created tests to ensure the functionality of the new cache invalidation method. - Updated key space change processing to include the `DeleteAPICache` action. ___ <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>api.go</strong><dd><code>Refactor API Cache Invalidation Logic</code> </dd></summary> <hr> gateway/api.go <li>Refactored cache invalidation logic into a separate method <br><code>invalidateAPICache</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-644cda3aeb4ac7f325359e85fcddb810f100dd5e6fa480b0d9f9363a743c4e05">+1/-5</a> </td> </tr> <tr> <td> <details> <summary><strong>delete_api_cache.go</strong><dd><code>Introduce Method for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache.go <li>Introduced a new method <code>invalidateAPICache</code> to encapsulate the cache <br>invalidation logic. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8606dab58155ef5aab8c6f3364c0c6cdab44cad70addd3cc427bbeb99d412de7">+10/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>redis_signals.go</strong><dd><code>Handle Delete API Cache Signal</code> </dd></summary> <hr> gateway/redis_signals.go <li>Added handling for <code>NoticeDeleteAPICache</code> signal to trigger cache <br>invalidation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-18cb136722c238e19b02741a85510dfd464343f85365482f0873aa60a37718af">+5/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_storage_handler.go</strong><dd><code>Process DeleteAPICache Action in Key Space Changes</code> </dd></summary> <hr> gateway/rpc_storage_handler.go <li>Added <code>DeleteAPICache</code> to the list of actions to process for key space <br>changes. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8875f75b602664c44b62b67a4da41d748124ad270573a44db4ec977ee5d68021">+4/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>delete_api_cache_test.go</strong><dd><code>Add Tests for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache_test.go - Added tests for the new `invalidateAPICache` method. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-bf04614dddae2c523c9030b8571e35816c01d916f0023b3b66f2e45f84c528bf">+34/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions (cherry picked from commit 43f5f5c)
|
@jeffy-mathew Succesfully merged PR |
<!-- Provide a general summary of your changes in the Title above --> This PR adds * A redis event handler to react on event `DeleteAPICache`, this is used when gateway is used in pro mode. * A processor in edge gateways to invalidate cache via `DeleteAPICache` action via mdcb RPC. https://tyktech.atlassian.net/browse/TT-11585 <!-- Why is this change required? What problem does it solve? --> <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ enhancement, bug_fix ___ - Introduced a new method `invalidateAPICache` to centralize the logic for API cache invalidation. - Added handling for a new signal `NoticeDeleteAPICache` to trigger the cache invalidation process. - Created tests to ensure the functionality of the new cache invalidation method. - Updated key space change processing to include the `DeleteAPICache` action. ___ <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>api.go</strong><dd><code>Refactor API Cache Invalidation Logic</code> </dd></summary> <hr> gateway/api.go <li>Refactored cache invalidation logic into a separate method <br><code>invalidateAPICache</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-644cda3aeb4ac7f325359e85fcddb810f100dd5e6fa480b0d9f9363a743c4e05">+1/-5</a> </td> </tr> <tr> <td> <details> <summary><strong>delete_api_cache.go</strong><dd><code>Introduce Method for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache.go <li>Introduced a new method <code>invalidateAPICache</code> to encapsulate the cache <br>invalidation logic. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8606dab58155ef5aab8c6f3364c0c6cdab44cad70addd3cc427bbeb99d412de7">+10/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>redis_signals.go</strong><dd><code>Handle Delete API Cache Signal</code> </dd></summary> <hr> gateway/redis_signals.go <li>Added handling for <code>NoticeDeleteAPICache</code> signal to trigger cache <br>invalidation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-18cb136722c238e19b02741a85510dfd464343f85365482f0873aa60a37718af">+5/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_storage_handler.go</strong><dd><code>Process DeleteAPICache Action in Key Space Changes</code> </dd></summary> <hr> gateway/rpc_storage_handler.go <li>Added <code>DeleteAPICache</code> to the list of actions to process for key space <br>changes. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8875f75b602664c44b62b67a4da41d748124ad270573a44db4ec977ee5d68021">+4/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>delete_api_cache_test.go</strong><dd><code>Add Tests for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache_test.go - Added tests for the new `invalidateAPICache` method. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-bf04614dddae2c523c9030b8571e35816c01d916f0023b3b66f2e45f84c528bf">+34/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions (cherry picked from commit 43f5f5c)
) (#6195) [TT-11585] Process DeleteAPICache event (#6190) ## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description This PR adds * A redis event handler to react on event `DeleteAPICache`, this is used when gateway is used in pro mode. * A processor in edge gateways to invalidate cache via `DeleteAPICache` action via mdcb RPC. ## Related Issue https://tyktech.atlassian.net/browse/TT-11585 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ ## **Type** enhancement, bug_fix ___ ## **Description** - Introduced a new method `invalidateAPICache` to centralize the logic for API cache invalidation. - Added handling for a new signal `NoticeDeleteAPICache` to trigger the cache invalidation process. - Created tests to ensure the functionality of the new cache invalidation method. - Updated key space change processing to include the `DeleteAPICache` action. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>api.go</strong><dd><code>Refactor API Cache Invalidation Logic</code> </dd></summary> <hr> gateway/api.go <li>Refactored cache invalidation logic into a separate method <br><code>invalidateAPICache</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-644cda3aeb4ac7f325359e85fcddb810f100dd5e6fa480b0d9f9363a743c4e05">+1/-5</a> </td> </tr> <tr> <td> <details> <summary><strong>delete_api_cache.go</strong><dd><code>Introduce Method for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache.go <li>Introduced a new method <code>invalidateAPICache</code> to encapsulate the cache <br>invalidation logic. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8606dab58155ef5aab8c6f3364c0c6cdab44cad70addd3cc427bbeb99d412de7">+10/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>redis_signals.go</strong><dd><code>Handle Delete API Cache Signal</code> </dd></summary> <hr> gateway/redis_signals.go <li>Added handling for <code>NoticeDeleteAPICache</code> signal to trigger cache <br>invalidation. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-18cb136722c238e19b02741a85510dfd464343f85365482f0873aa60a37718af">+5/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>rpc_storage_handler.go</strong><dd><code>Process DeleteAPICache Action in Key Space Changes</code> </dd></summary> <hr> gateway/rpc_storage_handler.go <li>Added <code>DeleteAPICache</code> to the list of actions to process for key space <br>changes. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-8875f75b602664c44b62b67a4da41d748124ad270573a44db4ec977ee5d68021">+4/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>delete_api_cache_test.go</strong><dd><code>Add Tests for API Cache Invalidation</code> </dd></summary> <hr> gateway/delete_api_cache_test.go - Added tests for the new `invalidateAPICache` method. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6190/files#diff-bf04614dddae2c523c9030b8571e35816c01d916f0023b3b66f2e45f84c528bf">+34/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions [TT-11585]: https://tyktech.atlassian.net/browse/TT-11585?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Jeffy Mathew <[email protected]>


User description
Description
This PR adds
DeleteAPICache, this is used when gateway is used in pro mode.DeleteAPICacheaction via mdcb RPC.Related Issue
https://tyktech.atlassian.net/browse/TT-11585
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
Type
enhancement, bug_fix
Description
invalidateAPICacheto centralize the logic for API cache invalidation.NoticeDeleteAPICacheto trigger the cache invalidation process.DeleteAPICacheaction.Changes walkthrough
api.go
Refactor API Cache Invalidation Logicgateway/api.go
invalidateAPICache.delete_api_cache.go
Introduce Method for API Cache Invalidationgateway/delete_api_cache.go
invalidateAPICacheto encapsulate the cacheinvalidation logic.
redis_signals.go
Handle Delete API Cache Signalgateway/redis_signals.go
NoticeDeleteAPICachesignal to trigger cacheinvalidation.
rpc_storage_handler.go
Process DeleteAPICache Action in Key Space Changesgateway/rpc_storage_handler.go
DeleteAPICacheto the list of actions to process for key spacechanges.
delete_api_cache_test.go
Add Tests for API Cache Invalidationgateway/delete_api_cache_test.go
invalidateAPICachemethod.