Re: Re: Dear Lazy Web: Pseudo Randomisation Strategies on Listing Websites
| From: | Andrew Ballard | Date: | Fri, 20 Aug 2010 13:24:01 +0000 |
| Subject: | Re: Re: Dear Lazy Web: Pseudo Randomisation Strategies on Listing Websites | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-307603@lists.php.net to get a copy of this message | ||
On Fri, Aug 20, 2010 at 9:05 AM, Colin Guthrie <gmane@colin.guthr.ie> wrote:
> Thanks everyone for responses.
>
> 'Twas brillig, and Nathan Rixham at 20/08/10 13:17 did gyre and gimble:
>> if you use mysql you can seed rand() with a number to get the same
>> random results out each time (for that seed number)
>>
>> SELECT * from table ORDER BY RAND(234)
>>
>> Then just use limit and offset as normal.
>
> This is a neat trick! Yeah that will avoid the need for the static
> lookup table with 32 randomised columns.
Would it work to return a list of some limited number of randomly
ordered "featured" listings/items on the page, while leaving the full
list ordered by whatever natural ordering (by date, order entered,
alphabetical, etc.)? That gives every owner a chance to appear in a
prominent spot on the page while solving the issue you cited about
page breaks (and SEO if that is a concern). You can still use any of
the suggestions that have been discussed to determine how frequently
the featured items list is reseeded to help make caching practical.
Just a thought.
Andrew