Help Center/ Object Storage Service/ FAQs/ Back to Source/ Why Is the Size of the File Retrieved by Mirroring Different from That of the Origin Server File?
Updated on 2026-08-20 GMT+08:00

Why Is the Size of the File Retrieved by Mirroring Different from That of the Origin Server File?

If the size of the file retrieved by mirroring is different from that of the file on the origin server, perform the following steps:

  1. Check the last modification time of the retrieved file stored in the bucket and the timestamp of the file on the origin server.
    • If the timestamp of the origin server file is later than the last modification time of the retrieved file in the bucket, the origin server file has been updated after the retrieved file is stored in the bucket.
    • If the timestamp of the origin server file is earlier than or equal to the last modification time of the retrieved file in the bucket, the origin server file has not been updated after the retrieved file is stored in the bucket. In this case, go to the next step.
  2. Check whether the back-to-source request contains special request headers.

    For example, when a client sends a request to OBS with the Content-Encoding:gzip request header, it indicates that the file can be compressed using the GNU zip algorithm after being retrieved. If the file pulled in a back-to-source request meets the compression conditions, the file obtained from the origin server will be compressed before being stored in the OBS bucket. This results in a file size mismatch between the origin server and OBS.

    To avoid this issue, you can configure back-to-source by mirroring rules as follows:

    • If you have specified Pass all parameters, you also need to select Do not pass specified parameters to prohibit the Content-Encoding parameter.

    • If you have specified Pass specified parameters, ensure that the allowed parameters do not contain the Content-Encoding parameter.

  3. Check whether an image processing style is configured for the bucket.

    For example, a client sends a request to an OBS bucket to obtain an image file, and the bucket is configured with an image processing style for resizing or slimming. If the requested image file does not exist in the bucket, OBS retrieves the image from the origin server specified in the back-to-source rule and stores the retrieved image in the bucket. The image processing style resizes or slims the image. As a result, the size of the image file in the bucket is different from that on the origin server.