Level3 Cache Invalidator
Automatically invalidates Level3 Cache for the specified urls.
Command Line Usage
- Compile the application
- Execute it in the following way
clear_level3_cache.exe YOUR_API_KEY YOUR_API_SECRET subdomain1.mydomain.com,subdomain2.mydomain.com email@example.com
- Create a Run Script Step Template with the following variables How?
- In the script type select
- Paste all the code from Level3Utils.cs
- Paste the following code snippet
var inputReader = new OctopusInput(); new CacheInvalidatorProgram(inputReader).Execute();
- Save it. Use it in your other Octopus projects.
How does it work?
The application sends two Http requests to the Level3 REST Api.
The first request is sent to
https://ws.level3.com/key/v1.0 to obtain an
AccessGroupId. Level 3 Key Documentation
The second request is sent to
https://ws.level3.com/invalidations/v1.0/YOUR_ACCESS_GROUP_ID to invalidate the cache for the specified properties. Level 3 Invalidations Documentation
Understanding the code
All of the code that actually does something is in the file Level3Utils.cs. Putting all of those classes in the same file was a necessary evil to simplify the integration with Octopus.
The entry point of the application is the class
CacheInvalidatorProgram. It receives an
IInputReader and an
ILogger so that it can be reused in multiple environments.
CacheInvalidator is the one responsible for creating and transmitting the Http requests.