Dancer: Avoid session altogether

I found a new toy: Dancer, the minimal effort perl web framework, see http://perldancer.org. Main advantage: easy to start even without any real webapp experience, good learning curve, nice community (still somewhat small) . Dancer code looks good. Some would even say elegant.

Anyways, I just noticed that I don't even need a session. I can just load info in class variable

our $memory_cache;

before sub { 
  if ($memory_cache) {
   
debug "cache exists";
} else {
    debug "cache does NOT yet exist;about to load";
 
    $memory_cache = 'blablabla';
    #that's how you would write it to a session
    #session cache => $memory_cache;

}

No votes yet
Theme provided by Danetsoft under GPL license from Danang Probo Sayekti