Hey guys,
After receiving an unexpected bill from Google, I have discovered that my Geocoding API suddenly saw a massive spike in requests (I only use the API for Toolset Maps).
The site associated with this ticket (indoorskydivingsource.com) usually receives around 200 requests per day and it suddenly spiked to 16,000 requests in one day. Another site that I have with Toolset Maps saw something similar, but it went from approx 20 requests per day to 25,000 requests in one day.
These both happened on different days in April. I have never seen it happen before.
Do you have any idea why this might happen? I have just loaded the cached data in Toolset Maps settings and the list is immense. Is it possible that the cache was deleted and reloaded?
If so, I can't work out how this would have happened. I had made some minor changes to one of the sites over that period – mostly just editing posts but I did run a database optimization with WP Rocket. Could this have cleared the cache?
The strange this is that I haven't even logged into the other site since long before the spike in API requests. Could the cache have been cleared because of an automatic WordPress or plugin update?
Any support would be greatly appreciated.
Kind regards,
Charlie
Hello,
Please follow our document to check if there is missing address cache in your website:
https://toolset.com/course-lesson/data-caching-for-maps-addresses/#checking-for-missing-cache-entries
section "Checking for Missing Cache Entries"
If there are lots of missing cache address entries in your website, you need to find them, check the address field value, check if them are valid Google address value:
hidden link
If they are not valid Google address values, I suggest you remove/reset them, and try to setup them one by one, make sure you are using the autosuggest value when you input into the address.
I already check for missing entries. There was 1. Obviously not significant.
As I mentioned in my last message, do you think there's any db cleanup that WP Rocket might do that would clear the cache?
No, I don't thin WP Rocket might clear the Toolset Map address cache.
According to our document:
https://toolset.com/2022/10/how-toolset-and-the-maps-static-api-can-help-you-cut-costs/
Unfortunately, the costs of using dynamic maps rises as your website grows and experiences more traffic. Every time a visitor loads a map on your site, the returned map counts towards Google’s Javascript API use. This can quickly bring your costs up into the double, and even triple digit territory.
If your website has lots of visitor, it will conducts the problem.
You might consider to use static map API, see above document, section "When to Use the Maps Static API"
Right, but my website traffic is constant. We're talking about 20 requests per day and then suddenly 25,000 requests in one day. My only guess is that the cache reloaded entirely, but I can't work out how this would happen. Even then, I still don't know why there would be 25,000 requests.
I have one post type with 871 entries. All of these posts have an address field in them. But this is still far from the 25,000 requests that happened on April 15.
As you mentioned above:
https://toolset.com/forums/topic/spike-in-google-geocoding-api-requests/#post-2602093
already check for missing entries. There was 1. Obviously not significant.
So I don't think WP Rocket have cleared the map cache.
In case your Google Map API key was exposed to other websites, I suggest you try these:
1) Recreate the Google Map API key, and add domain restrictions to it
https://toolset.com/course-lesson/creating-a-maps-api-key/
2) Follow Google document to add daily cap on usage to your protect
hidden link