Language navigation not working | Community
Skip to main content
April 24, 2025
Solved

Language navigation not working

  • April 24, 2025
  • 4 replies
  • 893 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Imran Khan

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>

4 replies

Level 4
April 24, 2025

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.

VineeVaAuthor
April 24, 2025

Page should automatically refresh when I press back button. 

And yes, the issue is still there in Incognito mode as well. 

Level 4
April 24, 2025

On your publisher, is it working fine?

Bhuwan_B
Community Advisor
Community Advisor
April 24, 2025

@vineeva Is this a Single Page Application ?

VineeVaAuthor
April 25, 2025

No its not a single page application

Imran Khan
Community Advisor
Imran KhanCommunity AdvisorAccepted solution
Community Advisor
April 28, 2025

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>

kautuk_sahni
Community Manager
Community Manager
July 9, 2025

@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!

Kautuk Sahni