在谷歌应用程序引擎更新静态文件 [英] updating static files in google app engine

查看:103
本文介绍了在谷歌应用程序引擎更新静态文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的应用程序提供了一个欢迎页面(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆