I'm looking for a simple way to store a counter in the server memory to allow page load selection, kind of (pseudocode):
if counter is odd then load page-x
else (even counter) load page-y
increment counter by 1
store counter in server's memory
Session variables would not help, among multiple users.
I understand this could be achieved storing a field into the database, but this seems a cloggy approach. Was wondering for something faster.
That's why I thought about some server side variables that are kept in memory across sessions....
Use APC, xCache, or memcache to save variables to cache instead of a database. Note however that a server reset will wipe out these values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With