On dispatcher URL- when we change language from the hamburger menu, then the page content is getting loaded according to the chosen language.
But when we go back to previous language page by clicking on the browser back button, then the page content is not updated, only the URL gets updated. (no network calls.)
Note: I am using language navigation core component.
解決済! 解決策の投稿を見る。
トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。
表示
返信
いいね!の合計
The issue occurs because the browser serves the previous page from its cache without making a new network request, leading to outdated content.
To fix this, proper cache-control headers (no-store, no-cache, must-revalidate) should be set on language switch pages to force a reload.
Try below approaches:
1. Add this to your Apache/Dispatcher configuration (vhost.conf or dispatcher.conf)
<LocationMatch "^/content/your-site/.*$">
Header always set Cache-Control "no-store, no-cache, must-revalidate, private"
Header always set Pragma "no-cache"
Header always set Expires "0"
</LocationMatch>
2. Ensure Apache mod_headers is enabled On the server:
a2enmod headers
service apache2 restart
<LocationMatch "^/content/your-site/([a-z]{2})/.*$">
Header always set Cache-Control "no-store, no-cache, must-revalidate, private"
</LocationMatch>
HI @VineeVa ,
I think this might be happening because of browser caching. Can you try doing a hard reload or opening the site in incognito mode to see if the issue still occurs? That should help confirm if it’s a cache-related issue.
Let me know if it works or you need more help.
Thanks.
表示
返信
いいね!の合計
Page should automatically refresh when I press back button.
And yes, the issue is still there in Incognito mode as well.
表示
返信
いいね!の合計
On your publisher, is it working fine?
表示
返信
いいね!の合計
No. Its not working
表示
返信
いいね!の合計
You can write some JS code to trigger a hard reload, ensuring the content gets updated when navigating back to the page.
表示
返信
いいね!の合計
No its not a single page application
表示
返信
いいね!の合計
The issue occurs because the browser serves the previous page from its cache without making a new network request, leading to outdated content.
To fix this, proper cache-control headers (no-store, no-cache, must-revalidate) should be set on language switch pages to force a reload.
Try below approaches:
1. Add this to your Apache/Dispatcher configuration (vhost.conf or dispatcher.conf)
<LocationMatch "^/content/your-site/.*$">
Header always set Cache-Control "no-store, no-cache, must-revalidate, private"
Header always set Pragma "no-cache"
Header always set Expires "0"
</LocationMatch>
2. Ensure Apache mod_headers is enabled On the server:
a2enmod headers
service apache2 restart
<LocationMatch "^/content/your-site/([a-z]{2})/.*$">
Header always set Cache-Control "no-store, no-cache, must-revalidate, private"
</LocationMatch>
@VineeVa Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!
表示
返信
いいね!の合計