Get Free Audit

Dynamic Menu Generation in Prestashop

May 30, 2016

659 Alex 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.

Igor Dragun
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.


PrestaShop Development

Take your online store to the next level with BelVG PrestaShop Development

Visit the page
Igor Dragun
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Igor

Post a new comment

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