8000 Cache for loaded translations · Issue #694 · ngx-translate/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cache for loaded translations #694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Micha-kun opened this issue Oct 4, 2017 · 2 comments
Closed

Cache for loaded translations #694

Micha-kun opened this issue Oct 4, 2017 · 2 comments

Comments

@Micha-kun
Copy link

I'm submitting a ... (check one with "x")

[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[x] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Current behavior
I'm using exensively this module for my translations. Currently, I'm downloading the translations using an api call, not an static json file. It works very well and I can add new labels or change translations from a DB dinamically. But now I'm currently seeing that every component that uses the service or pipe, makes a call to the api, without caching the data, even if the language is the same. Currently, there are like 30 calls to the api at least.

Expected/desired behavior
I'm expecting that the factory only makes a call per language and then caches the data until language changes.

Reproduction of the problem
Appoint to an external api for getting non-static translations.

What is the expected behavior?

What is the motivation / use case for changing the behavior?
Performance

Please tell us about your environment:
Windows 10
Visual Studio Code

  • ngx-translate version: 7.2.0

  • Angular version: 4.3.6

  • Browser: [all ]

@thongnx6
Copy link
thongnx6 commented Dec 12, 2017

Currently, I'm downloading the translations using an api call, not an static json file.

that's great, could you teach to me how to implement solution 🙏

@un33k
Copy link
un33k commented Oct 10, 2018

@Micha-kun why don't you just create a service for fetching via api, then cache it on the first fetch.

@rbalet rbalet closed this as completed Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0