使用Google App Engine + Spring MVC + Annotations加速问题

Oce*_*ive 3 java google-app-engine spring-mvc

我正在使用spring MVC和使用注释在GAE上开发应用程序.应用程序第一次加载需要很长时间,然后只要我访问应用程序就会表现良好.但是当我离开应用程序一分钟然后我再次访问它需要很长时间.我读过有类似问题的人,但没有谈到解决方案.有没有人有这个问题,并能够解决它?

一种解决方案是剥离我想要做的注释作为最后的选择.

谢谢

Kyl*_*yle 5

加速Spring初始加载的一种方法是禁用<context:component-scan base-package="app.controllers" />springapp-servlet.xml中的行,并手动指定应用程序中的所有控制器,如下所示:

<bean id="rootController" class="app.controllers.RootController" ></bean>
<bean id="otherController" class="app.controllers.OtherController" ></bean>
Run Code Online (Sandbox Code Playgroud)

我在Google App Engine上使用Spring MVC并且已经将请求加载到约3秒.