質問

On a JBoss server, lies a JSP. Lets call it takestoolong.jsp
It does some processing that takes up to 30-45 seconds. (Yes, I know it should be optimized). Then it returns. The 30-45 seconds is deemed too long for user experience for obvious reasons. So Akamai and load balancers are brought in so that this time can be reduced by caching the result of the request. At some point however, the jsp return content will change, and the cache will timeout. How do you prevent users from again seeing the 20-45 second download time? In particular how to you configure Akamai so that it does not use ip or other factors but returns processed result to the android device/user without the 30+ second delay? How to configure Akamai for Android devices?

役に立ちましたか?

解決

My suggestion would be to isolate the takestoolong.jsp from the user all together, so that they only ever see the cached result....

to do that you'd want a secondary process that makes the request to the takestoolong.jsp page (it could be a simple cron job that hits the service and writes the result to an html page) and then point the users (or Akamai at the server delivering the static fragment of HTML.

that way you can refresh the results without the user seeing a delay and even when the content does change until the moment that the write is committed the user will still see the old content but no delay

[FWIW used this approach to deal with a similar issue ... huge, horribly complex SQL query that had to grab data from SQL Server then run a bunch of sub-queries against a MySQL database and consolidate the response. By using the intermediary output page and relying on IIS and browser caching caching that the users sometimes had slightly more stale data that was the absolute truth but they never got exposed to the actual response time of the underlying query]

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top