Skip to main content




Find out how loading third-party resources faster can increase revenue.

This case study highlights how improving the performance of third-party resources can boost business metrics. While a previous study measured the cost of aggregate ad latency, this study demonstrates the real-world value of improved performance:

0,5%

Increased revenue for publishers

2%

Increased first ad script loads

Fuente: Datos internos de Google, junio a julio de 2019.

Background

the Google Publisher Tag (GPT) es la secuencia de comandos de etiquetado de anuncios para Google Ad Manager que solicita y muestra anuncios gráficos en la Web. Implementando un simple stale-while-revalidate Encabezado HTTP para GPT, el equipo de GPT pudo mejorar la velocidad y el rendimiento de los anuncios gráficos de Google para sus socios editores. Esta misma técnica se puede aplicar a cualquier otro escenario donde cargar scripts lo más rápido viable es más importante que cargar el código más actualizado.

The problem

GPT is implemented as a startup script, gpt.js, which has a short time to live (TTL) of 15 minutes. This short TTL makes it possible for the script to be quickly updated or rolled back. Once loaded, gpt.js requests and loads additional implementation scripts, which have a longer TTL.

After the 15-minute TTL expires, the version of gpt.js in cache se torna obsoleto y requiere ser revalidado. Previamente, este procedimiento de revalidación implicaba realizar una solicitud de red síncrona para conseguir una copia nueva de la secuencia de comandos, lo que agrega latencia a la primera solicitud de anuncio.

The answer

the stale-while-revalidate The attribute es utilizado por el Cache-Control header and sets an additional window of time during which a cache can use a stale asset while the asset is revalidated asynchronously. This helps developers balance immediacy:loading contents en caché de inmediato—And freshness—ensure that cached content updates are used in the future.

Google Display Ads Case Study

GPT team added this Cache-Control heading in the gpt.js Respuesta HTTP en 2016, en previsión de que los browsers implementen stale-while-revalidate:

cache-control: private, max-age = 900, stale-while-revalidate = 3600

This setting means that if gpt.js is requested between 15 and 60 minutes after the previous cached value, then the cached value will be used to fulfill the request even if it is stale. At the same time, a background revalidation request will be made to fill the cache with a new value for future use.

Chrome released stale-while-revalidate en la versión del 75 al 99% de todo el traffic, dejando el 1% del tráfico con la función desactivada temporalmente para medir su impacto. El equipo de GPT registró métricas de este 1% (el grupo experimental), así como una muestra del 1% de tráfico con la función habilitada (el grupo de control), para probar la eficacia de stale-while-revalidate para guiones de anuncios. En el transcurso de 2 semanas de métricas registradas a partir de un tamaño de muestra de 5200 millones de impressions de anuncios gráficos de Google, el grupo de control observó:

  • 0.3% increase in ad impressions.
  • 0.5% increase in revenue.
  • 2% increase in first ad script loads (<500 ms desde el inicio de la carga de la página).
  • 1.1% increase in overall successful ad script loads.

Source: Google internal data, June to July 2019.

As shown in the graph above, the results of this experiment can be attributed to an increase in successful ad script loads, with the majority occurring early in the page load process.

Implementation of obsolescence while revalidating on your site

El equipo de GPT ha visto que realizar un cambio relativamente simple en los headers HTTP con stale-while-revalidate can improve speed and increase business metrics. See the Keep things fresh with deprecation while revalidating post for more information on implementation stale-while-revalidate on your own site.

Photo by Kahica in Unsplash