परफ़ॉर्मेंस को बेहतर करें
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस दस्तावेज़ में कुछ ऐसी तकनीकें बताई गई हैं जिनका इस्तेमाल करके, अपने ऐप्लिकेशन की परफ़ॉर्मेंस को बेहतर बनाया जा सकता है. कुछ मामलों में, दिए गए आइडिया को समझाने के लिए, अन्य एपीआई या सामान्य एपीआई के उदाहरणों का इस्तेमाल किया जाता है. हालांकि, यही सिद्धांत Campaign Manager 360 API पर भी लागू होते हैं.
gzip का उपयोग करके संपीड़न
gzip कंप्रेसन की सुविधा चालू करके, हर अनुरोध के लिए ज़रूरी बैंडविड्थ को कम किया जा सकता है. यह एक आसान और सुविधाजनक तरीका है. हालांकि, नतीजों को अनकंप्रेस करने के लिए सीपीयू को ज़्यादा समय लगता है, लेकिन नेटवर्क की लागत के साथ समझौता करने पर, आम तौर पर यह बहुत फ़ायदेमंद होता है.
gzip से एन्कोड किया गया रिस्पॉन्स पाने के लिए, आपको दो काम करने होंगे: Accept-Encoding
हेडर सेट करना और अपने यूज़र एजेंट में स्ट्रिंग gzip
शामिल करने के लिए उसमें बदलाव करना. यहां gzip कंप्रेसन की सुविधा चालू करने के लिए, सही तरीके से बनाए गए एचटीटीपी हेडर का उदाहरण दिया गया है:
Accept-Encoding: gzip
User-Agent: my program (gzip)
आंशिक संसाधनों के साथ काम करना
एपीआई कॉल की परफ़ॉर्मेंस को बेहतर बनाने का एक और तरीका है, सिर्फ़ उस डेटा का अनुरोध करना जिसमें आपकी दिलचस्पी है. इससे आपके ऐप्लिकेशन को ज़रूरत के बिना फ़ील्ड ट्रांसफ़र करने, पार्स करने, और सेव करने से बचने में मदद मिलती है. इससे, नेटवर्क, सीपीयू, और मेमोरी जैसे रिसॉर्स का ज़्यादा बेहतर तरीके से इस्तेमाल किया जा सकता है.
अधूरे जवाब
डिफ़ॉल्ट रूप से, अनुरोधों को प्रोसेस करने के बाद सर्वर किसी संसाधन को पूरी तरह से दिखाने का अनुरोध करता है. बेहतर परफ़ॉर्मेंस के लिए, सर्वर से सिर्फ़ वे फ़ील्ड भेजने के लिए कहा जा सकता है जिनकी आपको ज़रूरत है. इससे आपको कुछ हद तक जवाब मिलता है.
कुछ हिस्से के जवाब का अनुरोध करने के लिए, fields
अनुरोध पैरामीटर का इस्तेमाल करके वे फ़ील्ड बताएं जो आपको वापस चाहिए. इस पैरामीटर का इस्तेमाल, जवाब के तौर पर डेटा दिखाने वाले किसी भी अनुरोध के साथ किया जा सकता है.
उदाहरण
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThis document outlines techniques for enhancing application performance, focusing on reducing bandwidth and resource usage.\u003c/p\u003e\n"],["\u003cp\u003eEnabling gzip compression, by setting specific HTTP headers, minimizes bandwidth consumption, despite requiring extra CPU time for decompression.\u003c/p\u003e\n"],["\u003cp\u003eOptimizing API calls by requesting only necessary data through partial responses, using the \u003ccode\u003efields\u003c/code\u003e parameter, improves network, CPU, and memory efficiency.\u003c/p\u003e\n"]]],[],null,["# Improve Performance\n\nThis document covers some techniques you can use to improve the performance of your application. In some cases, examples from other APIs or generic APIs are used to illustrate the ideas presented. However, the same concepts are applicable to the Campaign Manager 360 API.\n\nCompression using gzip\n----------------------\n\nAn easy and convenient way to reduce the bandwidth needed for each request is to enable gzip compression. Although this requires additional CPU time to uncompress the results, the trade-off with network costs usually makes it very worthwhile.\n\nIn order to receive a gzip-encoded response you must do two things: Set an `Accept-Encoding` header, and modify your user agent to contain the string `gzip`. Here is an example of properly formed HTTP headers for enabling gzip compression: \n\n```perl6\nAccept-Encoding: gzip\nUser-Agent: my program (gzip)\n```\n\nWorking with partial resources\n------------------------------\n\nAnother way to improve the performance of your API calls is by requesting only the portion of the data that you're interested in. This lets your application avoid transferring, parsing, and storing unneeded fields, so it can use resources including network, CPU, and memory more efficiently.\n\n### Partial response\n\nBy default, the server sends back the full representation of a resource after processing requests. For better performance, you can ask the server to send only the fields you really need and get a *partial response* instead.\n\nTo request a partial response, use the `fields` request parameter to specify the fields you want returned. You can use this parameter with any request that returns response data.\n\n#### Example"]]