No problem. Take a look at serialize(), unserialize(), etc.
Write the variables you want to a string, save to disk.
Objects do not survive through multiple page views, so you have to write to disk and then read, unserialize, then return the variable data.
I'd base the database query on the time since last file write - see filemtime or filectime depending on your methods. For even better performance, fork a background process to update the cache files on page load, rather than load db, write to file, then return results.
The use of a class to store variables can make sense if you feel that there may be name collisions. For example, I commonly use an object in my work, (usually called $CONF) that contains site-specific values that I know cannot cause name collisions with the root namespace, my functions, etc.
Just try to keep it simple and consistent - define methodologies and problem-solving procedures first, rather than code - and I'm sure your migration will go smoothly - as a consultant I've done this sort of a thing a few times 😉