Language navigation not working | Community
Skip to main content
New Participant
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.

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

kautuk_sahni
Employee
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
Imran__Khan
Imran__KhanAccepted solution
New Participant
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>

Bhuwan_B
New Participant
April 24, 2025

@vineeva Is this a Single Page Application ?

VineeVaAuthor
New Participant
April 25, 2025

No its not a single page application

New Participant
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
New Participant
April 24, 2025

Page should automatically refresh when I press back button. 

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

New Participant
April 24, 2025

On your publisher, is it working fine?