Comments (5)
Hi @creimers
How do you set ttl?
cache = {
'cache_class': MemoryCache,
'cache_config': {},
'serializer': StrSerializer,
'ttl': 3
}
from toapi.
Hey @howie6879 ,
my settings look like this. Pretty much how they came out of the generated project.
class MySettings(Settings):
cache = {
'cache_class': MemoryCache,
'cache_config': {},
'serializer': None,
'ttl': 60 * 60
}
storage = {
"PATH": os.path.dirname(os.path.abspath(__file__)),
"DB_URL": None
}
web = {
"with_ajax": False,
"request_config": {},
"headers": None
}
from toapi.
Hi @creimers ,
There is no problem with your settings.
I tried setting ttl: 2 * 3, the result is what I want:
2018/02/01 08:27:51 [Cache ] OK Set</one/>
2018/02/01 08:27:51 [Received] OK http://127.0.0.1:5000/one/ 6216 200 42.69ms
2018/02/01 08:27:54 [Cache ] OK Get</one/>
2018/02/01 08:27:54 [Received] OK http://127.0.0.1:5000/one/ 6216 200 0.20ms
2018/02/01 08:27:58 [Storage ] OK Get<http://wufazhuce.com/>
2018/02/01 08:27:58 [Parsed ] OK Item<Indexone[1]>
2018/02/01 08:27:58 [Parsed ] OK Item<Indexarticle[4]>
2018/02/01 08:27:58 [Parsed ] OK Item<Indexquestion[4]>
2018/02/01 08:27:58 [Cache ] OK Set</one/>
from toapi.
Hi. Thanks.
I can confirm that I can reproduce a similar behavior.
However, it is also the case that the results I get to see after the cache has died and new results are fetched are the same as the cached ones. Even if I know for sure that the data source has changed.
Once I delete the .html folder, I do get updated results. Anything I'm missing here?
from toapi.
Hi, @creimers
Sorry for the inconvenience, we allow users to set expiration time in storage, it looks like a bit of a problem now.
We will fix this issue quickly.
Thanks.
from toapi.
Related Issues (20)
- 关于post数据的获取和item是编写 HOT 6
- Add force-refresh on api HOT 1
- 使用toapi run 时出现问题 HOT 1
- 过滤删除无用的item
- Access to RawHTML from selectors HOT 2
- Production Deployment Instructions HOT 3
- python2.7安装报错 HOT 2
- How to set expiration on Local Storage
- toapi is easy toStar hard todevelope HOT 1
- Error: No such command "new". HOT 2
- ImportError: cannot import name 'XPath' HOT 2
- Flask logging error HOT 2
- SyntaxError: invalid syntax HOT 1
- modify routing argument 2
- Elements not always present on page
- Is this projects still active ?
- Problem: can't start the app
- Fix simple typo: programe -> program
- Your Documentation is unable to access HOT 1
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 toapi.