Auto Refresh Google Sitemap

I'd like to auto refresh the google sitemap say once a day, currently it seems you have to run it manually by clearing the cache each time you add new products. As I have no idea when my client adds new products the sitemap is sometimes out of date.

I've tried running the clear cache url ( from a cron job but this does seem to work presumably because the job is not authenticated within the control panel.

Any ideas?

You cannot clear cache without being logged into admin.

You will need to specify the file to delete in a cron job. If you just want to delete the file in question then the location is: /var/cache/sitemap.xml

OK that's great, thanks.

Also I just realised I have the same problem with the quick search add on (it needs refreshing to pick up new products), I don't suppose you know where the file is I need to delete for that is too?


The quick search depends on the cache method you are using.

If you clear the var/cache directory of all its contents, then you will basically reset all of the cached settings and query results.

But I think I'd report this as a bug. To me, when a product is added (new) it should be added to the quick search and other areas. However, the sitemap should be regenerated at a frequency defined in the addon. At the very least, the area of the cache that need to be recreated should be invalidated so that it will rebuild on next access.

OK thanks for your help. I have created a maintenance script which deletes the sitemap.xml and clears the quick search cache, Strangely I noticed if change a product name quick search does pick it up straight away but I dont believe it refreshes when adding a new product (well thats what the add-on settings screens says) so I just emptied /var/cache/quick_search/ anyway