resetDistributionCache method
Deletes currently cached content from your Amazon Lightsail content delivery network (CDN) distribution.
After resetting the cache, the next time a content request is made, your distribution pulls, serves, and caches it from the origin.
May throw ServiceException. May throw InvalidInputException. May throw NotFoundException. May throw OperationFailureException. May throw AccessDeniedException. May throw UnauthenticatedException.
Parameter distributionName
:
The name of the distribution for which to reset cache.
Use the GetDistributions
action to get a list of distribution
names that you can specify.
Implementation
Future<ResetDistributionCacheResult> resetDistributionCache({
String? distributionName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Lightsail_20161128.ResetDistributionCache'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (distributionName != null) 'distributionName': distributionName,
},
);
return ResetDistributionCacheResult.fromJson(jsonResponse.body);
}