apertium / apertium/apertium-apy

a little cache for web page translation?

Open
#52 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
39
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Some normal pages take up to 30s to translate with the giellatekno pairs.

Maybe we should try having a little
`{ pair : { url : translationOutput } }`
? Just for the slashdot effect where one page gets requested again and again.

Seeing as caching is Hard, we could keep it simple and just empty it when sys.getsizeof > max_url_cache. But sys.getsizeof doesn't recursively follow the size of the object; also, news sites etc. change, so I added a stupid simple "empty if older than two hours" rule for the whole cache object.

TODO:

- [ ] have a time stamp per url instead
- [ ] maybe don't save to cache if we already have N pages cached for that pair?
- [ ] fix it for py32 https://travis-ci.org/goavki/apertium-apy/jobs/197297317

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.