Alibaba Cloud CDN charges you for requests based on the number of log entries collected at the application layer (Layer 7). A request that fails to retrieve resources is still counted as one request because the failed request is parsed by points of presence (POPs) at the application layer. This topic provides answers to some commonly asked questions about the billing of requests.
A file is cached on the client. Am I charged for the request the second time the client requests the file from the POP?
Yes, you may be charged for the request.
Cause: The second time a file is requested, the POP detects that the file is cached and not updated. The HTTP 304 status code is returned. In this case, you are charged for the request and a small amount of data transfer is generated because the POP returns a small response packet. The fee varies based on the protocol over which requests are sent.
Am I charged when attackers send a large number of requests to my domain name?
Yes, you are charged for the requests.
Cause: If an attacker sends a large number of requests to your domain name, CDN mitigates the attacks at the application layer. The mitigation of attacks consumes resources and incurs fees. The fees for the requests vary based on whether the IP address blacklist or whitelist is enabled. The following section describes the billing rules:
If the blacklist or whitelist are disabled, no IP address is blocked. The requests and data transfer generate high fees.
If the blacklist or whitelist is enabled, the specified IP addresses are blocked. The number of requests sent to POPs and the amount of data transfer generated are significantly reduced. For more information, see Configure an IP address blacklist or whitelist.