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

238
Vistas
How to dynamically load a CSS file avoiding navigator cache

I've usually loaded CSS files with PHP by adding a GET variable that changes each time. For example the value of the microtime

But I need to dynamically load a CSS file avoiding navigator cache for see the continuous changes making in production development.

<?php echo '<link rel="stylesheet" type="text/css" href="myFile.css?v='.round(microtime(true)).'"></script>';?>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Sometimes you will need to load a dynamic file name as well. It is possible to do it without PHP like this:

<link rel="stylesheet" type="text/css" href="" id="myCSS">

<script>     
  var microTime = Date.now();   
  var myVar = "myCSSFile";
  var myUrl = myVar+'.css' + '?v=' + microTime;

  myCSS.href= myUrl;
</script>
about 4 years ago · Juan Pablo Isaza Denunciar
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