开发者

Prevent web2py from caching?

I'm working with web2py and for some reason web2py seems to fail to notice when code has changed in certain cases. I can开发者_StackOverflow社区't really narrow it down, but from time to time changes in the code are not reflected, web2py obviously has the old version cached somewhere.

The only thing that helps is quitting web2py and restarting it (i'm using the internal server).

Any hints ? Thank you !


web2py does cache your code, except for Google App Engine (for speed). That is not the problem. If you you edit code in models, views or controllers, you see the effect immediately.

The problem may be modules; if you edit code in modules you will not see the effect immediately, unless you import them with local_import('module', reload=True), or by restarting web2py.

Is that is also not your problem, then your browser is caching something. Please bring up this question to the web2py mailing list as we can help more.

P.S. If you are using the latest web2py it no longer comes with cherrypy. The built-in web server is called Rocket.


web2py itself shouldn't "cache" your code, but whatever app server you're using it on surely might. But web2py can be deployed on such a huge variety of app servers that it's impossible to give completely general suggestions.

If you're using the popular cherrypy WSGI server that I believe comes bundled with web2py, for example, see, in cherrypy's own docs, the AutoReload feature. Such features are not recommended in a production deployment (they can require very significant resources), but they sure come in handy when you're just developing!-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜