I've around 500,000 unique visitors, and I want my visitors be able to use my website a bit like StackOverflow. I mean you don't need to register but you have kind of an account which stores some preferences.
To do that, I create a member in the same I'll do for a user which wants to register, however I set some dummy values like user1234 as username, and a guest role.
I want them to be able to use it as long as they want without registering but not infinite which is no sense to me, so I'd like to purge开发者_StackOverflow社区 every 6 months for example.
However It may be a bit heavy if I plan to a lot of trafic.
Someone told me that I could work with memcached in front of MySQL; is it a good idea? How would you implement such thing?
By the way it means that I'll have the same amount of member in my member database which can grow too much, then I'll need to purge this too.
What do you think?
So you're expecting every single one of those anonymous visitors to lurk around your site without registering for six months? I highly doubt even a fraction of a percent of the lurkers would care to do that.
I'd just keep it simple and store that data in a $_SESSION
variable. If the anonymous users want to keep their preferences, then they should register. You don't need to tax your website's performance just to accommodate lazy users...
What about saving a cookie on the client side which will store the preferences of the user ?
精彩评论