Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

180
Vistas
How to clear cache for a Chrome extension's background process?

I see several questions about clearing cache in Chrome in general, but this is specific to my extension which uses a background script. I have an extension which retrieves Json data from a background script:

//In the content script
chrome.runtime.sendMessage({ query: 'getList' }, function (result) {
    //Uses list data
});

Inside the background js file, I'm retrieve data from a JQuery ajax call:

//In a background script
chrome.runtime.onMessage.addListener(
    function (request, sender, sendResponse) {
        $.get('http://example.com/data.txt', function (result) {
            sendResponse(result);
        });
});

I have updated the context of the data.txt file on my server. However, the Chrome extension continues to use the old data. I have the same exact code running in a Firefox add-on, and in Firefox I see the new data immediately when updating the .txt file.

I don't know how to tell whether the actual issue is that the sendMessage() call is just using a cached value instead of going to my background script, or whether my background script is just returning a cached value instead of retrieving the update from my server.

I updated the .txt file over a day ago, so it's not just a short-term caching issue. What can I do to force the Chrome extension itself to refresh the data coming from the background script? It does not appear to be a local issue; even uninstalling and re-installing the script doesn't fix the issue; it's not that it's being cached in my local Chrome cache.

If I visit http://example.com/data.txt in Chrome (or any browser), I see the updated file.

I'm guessing that if I deployed a new package to the Chrome Developer Dashboard, then it would clear. But the whole reason I have this background script and JQuery call is so that I can easily update this data without having to re-deploy the extension whenever it changes.

Is there anything that can be done from the Chrome Developer Dashboard to force it to refresh?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda