I want to create a web application with a model that persists between HTTP requests. From what I understand languages like PHP treat each HTTP request as a brand new connection except for some global variables like SESSION; so each time the user changes pages all my PHP classes are loaded into memory again (and each AJAX request does this too) - requiring me to build from the database each time.
Am I mistaken or am I trying to make a circle fit in a square? Memcached seems to be a good solution for keeping my model in memory between page requests but it still needs to load the cache. PHP CLI seemed promising but after looking into it more it seemed like it would be more trouble than it was worth. Any suggestions?