Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

287
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda