Comments (5)
Since the article won't be changed after published, I think long-time (months or years) cache or even directly store translated versions in the database may good choices.
Personally, I more prefer the latter:
- The memory of ElasticCache eaten by static contents is a waste;
- ElasticCache might be flushed at any time;
AWS S3 is also an option, but it may take more cost on implementation and billing (I/O, Network, Storage, etc.).
from matters-server.
For Caching Strategies, I think Lazy Loading is good for us, which means old & new articles don't need to be prefetched:
- Return translated data if exists in DB
- Retrieve translated data from Google Translate and store it in DB, then return
from matters-server.
For Caching Strategies, I think Lazy Loading is good for us, which means old & new articles don't need to be prefetched
Agreed. objectCache
directive is already using a simple lazy loading strategy: it tries to get data from cache, and if cache misses, it gets from original source, which is Google translation, and then stored in cache.
The delay in SSR query we saw yesterday were from a high peak in cache misses, which result in hitting translation rate limit. But it looks like the cache has been filled quite fast and most frequent viewed articles are cached now.
Personally, I more prefer the latter:
The memory of ElasticCache eaten by static contents is a waste;
ElasticCache might be flushed at any time;
AWS S3 is also an option, but it may take more cost on implementation and billing (I/O, Network, Storage, etc.).
Yes, the additional implementation cost is a good point. We will always need lazy loading cache strategy, and might want to expand its usage, so that we can guarantee a fast return for frequent viewed content.
If we decide to use a month or years long cache, maybe there is no need of disk storage, since Google translation call will be reduced a lot. However this way we will need to implement better cache purge or update mechanism, and handle rate limit issue (for example by returning null first) in case we need to update cache schemas 🤔
from matters-server.
Another thought is that, since we need to query language
for each article every time, we can store language
in database first.
from matters-server.
Implemented with #1149
from matters-server.
Related Issues (20)
- Wallet: revise walletLogin
- Move IPFS/IPNS publishing to lambda
- Stateless passphrases research HOT 1
- Revise default notification settings
- Remove onboarding state
- (Server) LikeCoin related changes
- Deprecate legacy notices HOT 1
- Review & revise non-email side effects
- Mock APIs
- Audit logs / change history for Social Login
- Mock Data/API for testing
- Remove tag auto-follow when adding tags to article
- Search user articles API
- Stateless Passphrase Implementation HOT 1
- Audit Logs Service: Implementation
- Upload image size limitation HOT 2
- Search result issue HOT 1
- fix tags_lasts errors in postgres logs
- fix postgres autovacuum failure HOT 1
- Stateless Passphrases Integration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matters-server.