Recently viewed products - how do u do it?
Posted: Tue May 17, 2011 5:06 am
Hi
I created a db table to store up to 5 products a person has visited.
However, because this particular web site gets a vast amount of viewings, the db table gather over 240,000 entry rows.
It stores them by their IP Address. So each time a product page is loaded, it looks for their IPs, and then deletes the oldest one and adds the latest. But looking for 5 IPs in 240,000+ rows is very time consuming.
And then on each page it looks for those 5 IPs and shows them on a page to show those 5 products.
It slowed the web site down BIG TIME.
Is there a better way to do this?
I created a db table to store up to 5 products a person has visited.
However, because this particular web site gets a vast amount of viewings, the db table gather over 240,000 entry rows.
It stores them by their IP Address. So each time a product page is loaded, it looks for their IPs, and then deletes the oldest one and adds the latest. But looking for 5 IPs in 240,000+ rows is very time consuming.
And then on each page it looks for those 5 IPs and shows them on a page to show those 5 products.
It slowed the web site down BIG TIME.
Is there a better way to do this?