Dynamic Menu Generation in Prestashop

May 30, 2016155Alex Simonchik
Dynamic Menu Generation in Prestashop

The larger a store becomes, the more complicated its catalog structure is. Simultaneously the store menu gets more complicated as well. Database queries get more complex and more time is needed for the page generation.

Server-side caching (NGINX in our case) and AJAX requests to the submenu items can be used as one of the ways to optimize the rendering process.

The idea is that server pulls out submenu items on a separate request. According to such an approach, only a top-menu level is generated during the page load. While opening a submenu item, the server checks whether there is a cached element and if necessary, generates it and sends to the client. Cash invalidation is not considered here, as this process should be triggered by the catalog structure change.

Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Igor

And here is the PHP Code, which generates static content. sendStaticJSON() function just saves already generated data into the cache storage and sends it to the client. We haven’t cluttered up the code with functions, not related to cashing.


Partner With Us Looking for a partner that will help you to grow your business? We are the right company to develop your webstore. Feel free to get in touch with us. We will be happy to discuss your business opportunities and provide you with a Free Quote. Talk to Igor

Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *