Các phương pháp hay nhất về hiệu suất
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Mỗi thao tác sẽ mất một khoảng thời gian nhất định để tải sản phẩm lên. Nếu bạn cần
tải nhiều sản phẩm lên trong một khoảng thời gian ngắn, điều này có thể khiến
có vẻ chậm.
Giải pháp đề xuất của chúng tôi là gọi song song CSS API.
Lệnh gọi song song
Để đẩy nhanh quá trình tải lên, bạn nên sử dụng lệnh gọi song song để tải lên
nhiều sản phẩm cùng lúc. Điều này có thể làm giảm đáng kể
thời gian tải lên. Sử dụng các tính năng phù hợp
cho ngôn ngữ lập trình của bạn.
Đối với Java, hãy sử dụng phiên bản không đồng bộ trong trình thực thi song song:
ApiFuture<CssProductInput> future =
cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);
Thao tác hàng loạt / hàng loạt
Mặc dù CSS không hỗ trợ trực tiếp thao tác hàng loạt và thao tác hàng loạt
API, nếu đang gọi API trực tiếp bằng HTTP, bạn có thể sử dụng Google API
tính năng hàng loạt mặc định. Để biết hướng dẫn chi tiết, hãy tham khảo
Nội dung đa phương tiện – CDN
hoặc Cloud Storage
tài liệu.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eUploading many products using the CSS API can be time-consuming due to individual operation times.\u003c/p\u003e\n"],["\u003cp\u003eTo expedite the upload process, leverage parallel calls to upload multiple products concurrently, significantly reducing the overall upload time.\u003c/p\u003e\n"],["\u003cp\u003eThough the CSS API doesn't directly support bulk/batch operations, when using HTTP directly, you can utilize the Google API default batch feature for enhanced efficiency, as detailed in the Media-CDN or Cloud Storage documentation.\u003c/p\u003e\n"]]],[],null,["# Performance best practices\n\nUploading products takes a certain amount of time per operation. If you need\nto upload many products in a short timeframe, this could cause the\nprocess to seem slow.\n\nOur recommended solution is to call the CSS API in parallel.\n\nParallel calls\n--------------\n\nTo speed up the upload process, we recommend using parallel calls to upload\nmultiple products simultaneously. This can significantly reduce overall\nupload time. Use the features appropriate\nfor your programming language.\n\nFor Java, use the asynchronous version within a parallel executor: \n\n ApiFuture\u003cCssProductInput\u003e future =\n cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);\n\nBulk / Batch operations\n-----------------------\n\nWhile bulk and batch operations aren't supported directly in the CSS\nAPI, if you are calling the API directly using HTTP you can use the Google API\ndefault batch feature. For detailed instructions, refer to the\n[Media-CDN](https://cloud.google.com/media-cdn/docs/api/batch)\nor the [Cloud Storage](https://cloud.google.com/storage/docs/batch)\ndocumentation."]]