This topic describes the functions of file gateway cache.

When a local client uploads a file to OSS through a file gateway, file data is written to the file gateway cache first. After the complete file is written to the cache, the file gateway starts uploading the file to OSS. If new files are written to the cache while the file gateway is uploading the current file to OSS, the upload is interrupted. The upload is resumed only after the new files are completely written to the cache. OSS requires atomic data updates. Therefore, files can be uploaded to OSS only after they are completely written to the file gateway cache. This ensures data consistency between the local client and OSS.

After the cached file is uploaded to OSS, the file gateway replaces the cached data depending on how frequently the data is accessed to maintain the cache capacity. The cache replacement polices only apply to file data that has already been uploaded to OSS. The metadata, such as the file name, directory hierarchy, and permissions, of the file will not be replaced.

When you add a cache disk, you can use a cache calculator to calculate the appropriate amount of cache capacity.