Answer the question
In order to leave comments, you need to log in
How to organize the generation of links for an online store?
I am making an online store with a regular directory /catalog /under the directory /under the directory/ product card, it can also be /catalog / product card.
I store all the names of categories and product cards in the database.
in yii2 it parses these links without problems.
but in the createUrl function where the rules for generating links are set,
you will need to contact the database to form links, and if there are 150 links on the page (for example, in the catalog menu), then it will constantly access the database.
how to do it here?
if you use a cache, which one: DB, Files or PHP expansion of memcache and memcached
Answer the question
In order to leave comments, you need to log in
Any cache will do. In yii, caching is essentially separated from the type of cache. So the implementation is the same. It all depends on what is on the server.
But in theory, if a greedy load, then the connections will come with 1 request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question