[2.0] Extension translations stay cached after an extension is updated
Current Behavior
Extension translations stay stale in the browser after an extension is updated, so new strings render as raw keys (for example ui.summary) and changed strings keep their old text.
Extension translation groups are loaded through /locales/locale.json?locale=en&namespace=ext-<id>::messages&hash=<build hash> (resources/scripts/i18n.ts). The hash query parameter is the panel's own build hash (import.meta.env.WEBPACK_BUILD_HASH), and LocaleController answers with Cache-Control: public, max-age=3600, stale-while-revalidate=86400.
Installing, upgrading or enabling an extension does not change the panel build hash, so the URL stays the same and the browser keeps serving the previous version of the extension's resources/lang/<locale>/messages.php for up to an hour, and up to a day stale. The server already returns the new strings; only the cached response is old.
Expected Behavior
After an extension is installed or upgraded and the page is reloaded (as the SDK docs instruct), its translations should match the installed version, the same way its frontend bundle does (/assets/extensions/<id>/<sha256>/client.js changes with each build).
Possible fixes: include a fingerprint of the enabled extensions (id + version or asset hash) in the hash query parameter for ext-* namespaces, or serve extension namespaces with no-cache and rely on the ETag that is already sent.
Steps to Reproduce
- Install an extension that registers translations with
loadExtensionTranslations()and reads them withuseExtensionTranslation('messages'). - Open a page that uses those strings, so the browser caches
/locales/locale.json?...&namespace=ext-<id>::messages. - Add a new key to
resources/lang/en/messages.php(and use it in the frontend), rebuild, thenphp artisan p:extension:install <package> --enable. - Reload the page normally.
- The new key renders as the raw key;
curlon the same URL shows the server already returns the new string. A hard reload (bypassing the cache) fixes it.
Panel Version
2.0.0-dev (2.0-develop @ d3410f8)
Wings Version
1.13.3
Games and/or Eggs Affected
None (panel UI)
Docker Image
No response
Error Logs
No response
Is there an existing issue for this?
- [X] I have searched the existing issues before opening this issue. I understand that maintainers may close this issue without communication if I have not provided sufficient information.
Just a quick advice about this issue: This issue description i wrote with AI Help tool (Claude code Opus 5.5) to mantain a better undestanding of the issue for the pterodactyl developers, i reviewed the bugs before posting.
The bug ocurred while i was developing a extension for the panel 2.0 version, when i updated the extension the new strings become raw keys instead the translation. I did requests on the backend and i saw that the server was already sending the new translations, so only a hard reload on the page (CMD + SHIFT + R) has resolved the situation.
Fixed by e52fdfd416a26d08032f7747800cd849d3b2c856