Jump to content

Speeding up Layer Navigation Block


Pressed0024
 Share

Recommended Posts

While modules like Page Cache and JavaPro are making significant contributions to Prestashop speed, one thing that bugs me is the Layer Navigation Block. Because it cannot be cached, it needs to constantly query db.

 

Unfortunately, while I'm getting acceptable speeds when toggling between filter options, I thought it should be near instant. I'm currently doing 1 sec with the above 2 modules turned on. Store has 280+ products with features and attributes.

 

Is there any module that can bring this down to 0.2 sec for a much better user experience? Obviously my goal here is to NOT purchase more hardware.

  • Like 1

Share this post


Link to post
Share on other sites

it should be very simple to add cache to block layered.  I will look at this and report back in the next few days.

 

cache as implemented is still file based, I'd rather see first call file, which then moves to memory for subsequent calls both at the session and server (global) level.

 

this would put some giddy up in all processes that use native cache technique. :)

 

thanks pressed, I was wondering what to do with myself. :)

  • Like 1

Share this post


Link to post
Share on other sites

Can Prestashop actually handle and put cache into memory? I thought those are server level config that needs to be installed by server admin (eg. APC). Forgive me if I'm wrong.

 

server and session level storage  $_SERVER | $_SESSION

Share this post


Link to post
Share on other sites

server and session level storage  $_SERVER | $_SESSION

 

Interesting. With 2gb RAM, it would be interesting to use it with default layer nav. I have a theme that uses Layer Navigation Block (mod). It is modified to work with rollover image and yotpo review at product listing page.

 

If there is a module with feature to cache layer nav results in memory, it would have to work on top of existing layer nav module provided by the themes.

Share this post


Link to post
Share on other sites

Interesting. With 2gb RAM, it would be interesting to use it with default layer nav. I have a theme that uses Layer Navigation Block (mod). It is modified to work with rollover image and yotpo review at product listing page.

 

If there is a module with feature to cache layer nav results in memory, it would have to work on top of existing layer nav module provided by the themes.

 

exactly..I started out on mainframes for super large shops that only had 16mb...yes, I am that old.  One can have 2gig and only use 128mb.  You can even tell php it has memory of 2gb but it may only use 128mb.  So there is loads of memory that does not get used.  I have some modules PrestaVault for example that use this technique for speed and older sites I wrote that used memory as opposed to file solutions, zoom zoom.

  • Like 1

Share this post


Link to post
Share on other sites

  • 2 months later...

Here is something you can try:

 

Open modules/blocklayered/blocklayered.php

 

Find following code and modify 20000 to value less than your total products

			if ($products_count < 20000) // Lock template filter creation if too many products
				$this->rebuildLayeredCache();

Please let us know the results.

Share this post


Link to post
Share on other sites

  • 8 months later...

So far I've used 2 filter modules that are way faster than layered navigation:

 

- Advanced Search 4: http://www.presta-module.com/en/3-prestashop-addons/6-merchandising/7-advanced-search-4.html

 

- Filter Search PRO: http://filtersearchpro.co.uk/en/

 

Each one has it's one pros and cons, so it's up to you to decide which one should you go for.

 

Filter Search PRO has been eoled no? i can't find it

Share this post


Link to post
Share on other sites

Here is something you can try:

 

Open modules/blocklayered/blocklayered.php

 

Find following code and modify 20000 to value less than your total products

			if ($products_count < 20000) // Lock template filter creation if too many products
				$this->rebuildLayeredCache();

Please let us know the results.

 

Did not find any changes on my website.

 

It is quite slow... desperately slow.

 

I am working on a VPS with 2 vCPU's and 4GB of ram and when i enable this the site literally stops

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More