Caching issue in Wordpress

Finally managed to get the WordPress site up and running on my VPS with power of Hestia.

A big thanks to Hestia team… :pray:

On the server have implemented a Cron Job that runs every 2 hours and fetches images from a weather site and saves them in a folder called imd located inside public_html folder.

But when this images are updated the updated image do not show up on the web pages and the viewer has to refresh the browser several times to see updated images.

How to solve this Cache issue?

Is there any command I can execute inside a Cron Job to force Hestia to clear its cache?

Welcome to the HestiaCP forum.

You may want to use the API with an Access Key for that. You could add it into your existing script after you update the images.

1 Like

Statics images are cached for 30 days only method to prevent it change the name of the file everytime or add ?xxx=randomtime

Thanks everyone for lending a helping hand.

I have setup a CRON job that runs every hour and downloads lots of images in a designated folder.

At the end of the CRON job I am executing the following command:

#Clear server Cache
v-purge-nginx-cache <User> <Domain>

I hope this is the correct way.

1 Like