[haXe] object that stays around between web requests?

Nicolas Cannasse ncannasse at motion-twin.com
Tue Aug 1 15:15:02 CEST 2006


>>If you're after simplicity, using database to store sessions is the 
>>way to go. neko.Web.cacheModule has other advantages, which is to 
>>cache "static datas" which are read-only datas extracted from 
>>XML/database when the application runs for the first time.
> 
> 
> The second "problem" without some kind of common memory is database 
> connection pooling...

In general, we open a connection and close it after each request. It
works and scale well, since you don't have "sleeping" connections.

> What is the purpose of neko.Web.cacheModule()? Code is cached as opposed to?

Bytecode is cached as opposed to reloaded from the .n file for every
request. Hence speedup.

Classes and statics are cached as opposed as garbage collected after
each request. Hence scales better since you can do complex
initializations at loading-time only.

> Another question is - I've only dealt with Index.hx with static function 
> main() doing things. From that I cannot understand the wider picture of 
> server side development. Can someone point me to discussions about this 
> topic, or can someone elaborate on this?

There are some infos on the Neko website, maybe this should be
documented on the haXe site as well.

http://nekovm.org/doc/mod_neko#script_versus_application

Nicolas



More information about the Haxe mailing list