效能最佳做法
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
每項作業上傳產品都會經過一定的時間。如果需要
短時間上傳許多產品
看起來似乎很慢
建議您同時呼叫 CSS API。
平行呼叫
如要加快上傳程序,建議您使用平行呼叫上傳
多項產品這會大幅減少
上傳時間。使用適合的功能
找出適合您的程式設計語言
如果是 Java,請在平行執行程式中使用非同步版本:
ApiFuture<CssProductInput> future =
cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);
大量 / 批次作業
雖然 CSS 無法直接支援大量和批次作業
API,如果你直接使用 HTTP 呼叫 API,則可以使用 Google API
預設批次功能如需詳細操作說明,請參閱
媒體 - CDN
或 Cloud Storage
說明文件。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\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."]]