say my application has a small 20 row information table in the database
that stores names of airlines:
“continental”, “delta”, united" , etc…
These names will be used in various pages of the application for all the
website users for different actions. They do not expect to change often.
what I do now is - when a user logs in - these airline names are queried
from the db and stored in session. Then every action that needs them
will get them from session instead of querying the database.
What I wanted to do is not query this table again and again for every
action. It just occured to me that i merely replaced a db query for a
session file access. Maybe a little faster in some cases for also not
the best way to go.
What’s the best solution for this? can I store this array of strings in
some global constant after fetching them from the database for the first
time when a user logs in? how? what will happen when I change the
contents of the table in the database every few weeks? (i guess i still
have this problem with sessions too, if a user is logged in while I make