Improving Performance Using BOSS

Yahoo BOSS is a critical part of many online sites and it is important that these sites can maximize the performance benefits that BOSS can provide site owners. We have provided you a helpful guide of suggestions for using BOSS.

1. Using GZIP when Retrieving Results

Yahoo BOSS supports the response to be zipped when sending over the network. Enabling gzip encoding ensures that the data transmitted is reduced in size and hence transferred faster.

To enable gzip in PHP here is a snippet of code. Please refer to the documentation of the programming language of your choice if you have further questions.

2. Keep Alive Header

Yahoo BOSS supports persistent HTTP connections via a Keep Alive Header. Adding this header to your BOSS request ensures that you re-use an existing connection and hence reduce handshake time significantly.

You can use Keep Alive connections by turning on the Keep Alive header in your request. Here is a snippet of code using PHP.

Note

It is not recommended using Persistent HTTP with SSL turned on.

3. Controlling the Number of Results Returned

Yahoo BOSS Search by default returns as many as 50 results per query for services such as web search. Most sites however do not need such a large set of results. The performance of API is driven by the number of results requested. If your site only has a need for 10 results per query, then make sure to only request that set. The response will be faster. You can control the number of results returned using the count parameter.

Here is a sample call that shows how to use it using a simple web search call:

This query returns only 10 results for dvd in JSON format.

Table of Contents