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

276
Vistas
How to clear server and browser cache in WordPress

I have a plugin that randomly displays images on front-end. It's working good on non cache website, but for people using in siteground or wpengine, the same image is showing instead of random. I tried appending the unique id to each image like the below code, but it is not generating the unique id on server cache systems. Instead, it is showing the first time generated id with the same image every time.

<img src="image.png?v=<?php echo mt_rand( 1000, 9999 ); ?>" />

I also added the below code for siteground cache (SG Optimizer WP Plugin), but it still won't work:

if (function_exists('sg_cachepress_purge_cache')) {
    sg_cachepress_purge_cache();
}

Is there any solution to solve this problem? How can I show random image on all server cache websites, too.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If you have the same name for images. Then Why not give each image a different name.

about 4 years ago · Santiago Trujillo 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