在谷歌应用程序引擎更新静态文件 [英] updating static files in google app engine
问题描述
我为我的应用程序提供了一个欢迎页面(JSP文件),其中包含一些动态内容。最近的帖子链接,最活跃的类别等。
为了使这项工作,我需要做一些数据存储查询返回这些数据。这是非常不优化的。特别是在主页中,并且与JSP文件中的这些链接的硬编码相比,加载时间更长。
我正在考虑通过使用cron任务使用最新数据每天更新静态JSP文件。从而实际上生成一个JSP文件并替换旧文件。你认为这是可能的吗?我也接受任何想法!
谢谢;
不,你做不到因为在Google App Engine上安全沙箱环境时,应用程序无法写入文件系统。
为了改善主页的性能,考虑将数据库结果缓存在 memcache 。
I have a welcome page (JSP file) for my application that contains some dynamic content.
e.g. recent posts links, most active categories etc.
To make this work I need to make some data store queries that return these data. this is pretty much unoptimized. especially in the home page and makes its loading time big as compared to hard coding these links in the JSP file.
I am thinking of updating the static JSP file every day with latest data by using a cron task. thus, actually generating a JSP file and replacing the old one. Do you think this is possible? I am also open to any ideas!
thanks;
No, you can't do it because on Google App Engine secure sandbox environment an application cannot write to the filesystem.
In order to improve the homepage's performance consider to cache the db results in memcache.
这篇关于在谷歌应用程序引擎更新静态文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!