แนวทางปฏิบัติแนะนำด้านประสิทธิภาพ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การอัปโหลดผลิตภัณฑ์จะใช้เวลาระยะหนึ่งต่อการดำเนินการ หากต้องการ
เพื่ออัปโหลดผลิตภัณฑ์จำนวนมากภายในกรอบเวลาสั้นๆ วิธีนี้อาจทำให้
ดูเหมือนจะช้า
วิธีแก้ปัญหาที่เราแนะนำคือการเรียกใช้ CSS API พร้อมกัน
การโทรพร้อมกัน
หากต้องการเร่งกระบวนการอัปโหลด เราขอแนะนำให้ใช้การเรียกพร้อมกันเพื่ออัปโหลด
ผลิตภัณฑ์หลายรายการพร้อมกัน ซึ่งอาจลดการทำงานโดยรวม
เวลาที่ใช้ในการอัปโหลด ใช้ฟีเจอร์ที่เหมาะสม
สำหรับภาษาโปรแกรมของคุณด้วย
สำหรับ Java ให้ใช้เวอร์ชันอะซิงโครนัสภายในตัวดำเนินการแบบขนาน:
ApiFuture<CssProductInput> future =
cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);
การดำเนินการเป็นกลุ่ม / กลุ่ม
แม้ว่าระบบจะไม่รองรับการดำเนินการแบบกลุ่มและแบบแบบกลุ่มใน CSS โดยตรง
API ถ้าคุณเรียก API โดยตรงโดยใช้ HTTP คุณสามารถใช้ Google API
ฟีเจอร์แบบกลุ่มเริ่มต้น ดูวิธีการอย่างละเอียดได้ที่
สื่อ-CDN
หรือ Cloud Storage
เอกสารประกอบ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 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."]]