Cache vary for Dynamic cache/Super cache.
-
Hello,
We are using SiteGround hosting and have enabled dynamic caching and file caching in the speed optimizer settings. Our website supports multiple languages as we serve various regions. The default language is set based on the HTTP Accept-Language header. Additionally, we serve dynamic content based on the visitor’s country.
Currently, we are facing an issue with the SG CachePress plugin, which lacks cache vary options. There is only one cache copy for all users. For example, if we purge the cache and the next visitor is from France, all subsequent users, regardless of their location, will be served the French version (with French language and dynamic content).
I attempted to modify the code to serve cache copies based on the language header and country code, but this only works when I enable development mode (which disables CDN) in the control panel. However, enabling development mode increases the TTFB from 70ms to 800ms, which is a significant tradeoff.
Is there a native way to achieve this? I also turned off Nginx Direct Delivery in the control panel, but that did not help. It seems that even with file caching enabled, the content is being served from server memory or the CDN, not from the hosting (I verified this by changing the content).
Please let me know if you need any further information.
Thank you.
- You must be logged in to reply to this topic.