php - Using HTTP Session VS serialized JSON array to store an SQL result -


i have bunch of virtual host subdomains use same source code. each subdomain has row in settings table has settings subdomain. these settings determine things html template load, age rating , around 30 other settings vital. rather query db every single time page loaded, want find way save data duration of session reduce load on db.

if use sessions can query db if session doesnt exist , save contents of query session can use values on each page load determine how page should displayed. question here huge amount of session variables users create performance hit?

alternatively thinking query db , save contents of array file json.i read file upon each page load settings. refreshed every hour or , shared across users on each subdomain. issue here massive amount of requests single json file hurt disk performance?

traditionally people use memcache. it's in memory cache system store key value pairs. http://php.net/manual/en/book.memcache.php


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -