Hi,
We found that if the product has too many variations and the server memory is low, it causes a fatal error on the product page. That’s why we implemented Ajax to set the transient data. But only for the first time. If you reload the page after the first Ajax load, you can see that it will load without an Ajax call.
Hey,
Thanks, yeah but the ajax loads everytime due to the site being cached…. and the inline js data not being updated.
which cache plugin you are using.
kindly send me the cache configuration and i will check it in our dev server.
The particular site uses wp fastest cache, but it should be repeatable by any caching plugin.
For example you have a variable product, you visit the page and it gets cached,
You then switch arround the variations and the ajax action saves/updates the transients, but the inline script with the ‘wpgs_js_data’ doesnt get updated so the ajax is called every time…
Hi there,
You’re right about the issue with caching ‘wp_localize_script’ not being updated on the second load. I’ve checked the plugin options but couldn’t find the setting to exclude inline JavaScript. Could you please reach out to their support and ask how to exclude inline JavaScript from caching?
As we haven’t received a recent response, I’ll mark this as resolved.
Feel free to open a new topic, if you continue encountering issues or reopen this topic.
We’d be happy to assist