Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

280
Views
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 answers
Answer question

0

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

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!