성능 관련 도움말
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 문서에서는 애플리케이션의 성능을 개선할 수 있는 몇 가지 기술에 대해 설명합니다. 경우에 따라 개념을 설명하기 위해 다른 API 또는 일반적인 API의 예가 사용되기도 하지만, Ad Exchange 구매자 API에도 동일한 개념이 적용됩니다.
gzip을 사용한 압축
각 요청에 필요한 대역폭을 줄이는 쉽고 편리한 한 가지 방법은 gzip 압축을 사용하는 것입니다. 이 경우 결과를 압축 해제하려면 CPU 시간이 추가로 필요하기는 하지만 대신에 네트워크 비용을 절감할 수 있다는 장점이 있습니다.
gzip으로 인코딩된 응답을 받으려면 Accept-Encoding
헤더를 설정하고 사용자 에이전트에 gzip
문자열이 포함되도록 수정해야 합니다. 다음은 gzip 압축을 사용할 수 있도록 적절하게 구성된 HTTP 헤더의 예시입니다.
Accept-Encoding: gzip
User-Agent: my program (gzip)
부분 리소스 작업
API 호출의 성능을 개선할 수 있는 또 다른 방법은 데이터에서 관심 있는 부분만 요청하는 것입니다. 이렇게 하면 애플리케이션에서 불필요한 필드를 전송하고 파싱하고 저장하지 않게 되므로 네트워크, CPU, 메모리를 포함한 리소스를 더 효율적으로 사용할 수 있습니다.
부분 응답
기본적으로 서버에서는 요청을 처리한 후에 전체 리소스 표현을 반환합니다. 더 나은 성능을 위해 서버에 필요한 필드만 전송하도록 요청하여 부분 응답을 받을 수 있습니다.
부분 응답을 요청하려면 fields
요청 매개변수를 사용하여 반환받을 필드를 지정합니다. 응답 데이터를 반환하는 모든 요청에서 이 매개변수를 사용할 수 있습니다.
예
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eEnabling gzip compression reduces bandwidth usage by compressing data, which often outweighs the cost of extra CPU time required for decompression.\u003c/p\u003e\n"],["\u003cp\u003eTo receive a gzip-encoded response, set the \u003ccode\u003eAccept-Encoding\u003c/code\u003e header to \u003ccode\u003egzip\u003c/code\u003e and include \u003ccode\u003egzip\u003c/code\u003e in your user agent string.\u003c/p\u003e\n"],["\u003cp\u003eRequesting partial resources, by only retrieving the data fields you need, improves application performance by conserving resources such as network, CPU, and memory.\u003c/p\u003e\n"],["\u003cp\u003ePartial responses are achieved by using the \u003ccode\u003efields\u003c/code\u003e request parameter to specify which fields you want returned from the server, instead of receiving the full resource representation.\u003c/p\u003e\n"]]],["To enhance application performance, enable gzip compression by setting the `Accept-Encoding: gzip` header and including `gzip` in the `User-Agent`. Additionally, request only necessary data by utilizing partial responses. Employ the `fields` request parameter to specify desired fields, thereby reducing data transfer, parsing, and storage overhead, optimizing network, CPU, and memory usage. These techniques can be used for the Ad Exchange Buyer API.\n"],null,["# Performance Tips\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 Ad Exchange Buyer 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"]]