G
G
glem13372019-06-28 13:49:15
PHP
glem1337, 2019-06-28 13:49:15

Is it possible to cache the results of randomly sorting a directory?

The SEO department creates synthetic landing pages. There will be a lot of them, about 1500 pieces. On these pages, you need to display products in a random sort to increase the uniqueness of the pages. However, the content must be static, that is, it was displayed randomly, and if a person comes in again, then the content should be the same.
Randomizing happened in this way . In theory, you can save the order of elements through , but the problem is that the sort order must be the same for all users. That is, in fact, randomization should occur once, and then the content should remain the same, or at least be the same for a long time for all users. Is there any way to achieve this result. Or will it be necessary to create custom samples?"ELEMENT_SORT_FIELD" => "rand",$_SESSION
UPD: There was an idea to create a log file, for example json, and check whether it exists or not. If there is, pull the information from it, if not, then write it into it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
glem1337, 2019-06-28
@glem1337

Everything turned out to be much more prosaic. It was possible to solve the problem in a standard way.

"CACHE_TIME" => "3154000000", // 100 лет
"CACHE_TYPE" => "Y",

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question