Persistent Models Between HTTP Requests

I want to create a web application with a model that is saved between HTTP requests. From what I understand, languages ​​such as PHP treat each HTTP request as a completely new connection, with the exception of some global variables such as SESSION; therefore, every time a user changes pages, all my PHP classes are loaded into memory again (and every AJAX request does this too) - I need to create it from the database every time.

Am I mistaken or trying to make a circle squared? Memcached seems to be a good solution to keep my model in memory between page requests, but it still needs to load the cache. The PHP CLI seemed promising, but looking at it seemed like it would be more of a problem than it was worth it. Any suggestions?

+3
source share
2 answers

-; HTTP , -. , PHP , . PHP. memcache .

, ( memcache) , . , , .

+4

, . , , HTTP, .

php IPC php_shmop.

nodejs this

+1

Source: https://habr.com/ru/post/1793335/


All Articles