The FiboFilters plugin was built to be significantly faster than the competition. This is achieved in part by eliminating client-server communication during filtering. The whole filtering process and calculating the counters takes place on the browser side. This reduces the server response time – up to 2 seconds – to zero. From the user perspective, the filtering is instant. We’re proud to have eliminated one of the main pain points for e-commerce customers.
The customer perspective
To work properly, FiboFilters needs a properly built filtering index.
Loading Descriptors on customers’ first visit
- On the customer’s first visit to your store, a server request is sent to download all data necessary for the filtering process (this is the only case where this action is necessary). This index we call “descriptors”.
- Descriptors are stored in the file:
/wp-content/uploads/fibofilters/filters-descriptors-{$indext_build_id}.json
For example, a descriptor for 10000 products and 10 filters can weigh around 155kB, assuming it’s gzipped. This is roughly an equivalent of a few images. - Descriptors are stored in the cache storage – the customer downloads them and uses them as long as the index isn’t rebuilt. Please review for our article for more information on when the index will be rebuilt
- Descriptors are modified dynamically when the product data has been changed, for example, stock status or a product category. The cache will be fully refreshed only after the whole index is rebuilt.
Filtering (after the filter state changes)
What is considered a filter state change? A filter state change occurs every time customers make a choice. For example, they select a “yellow color” T-shirt – this is considered the first change of state. Then, they also select a “yellow color” + “XL size” – the state changes again, and so on.
- Product ID’s matching the filtering query are calculated
- Information about selected filters, also known as applied filters, is displayed
- The filter status is refreshed and the counters are recalculated
Product rendering
- The HTML product templates that haven’t been displayed yet are downloaded with the AJAX request
- The products are rendered
- Other elements, such as pagination,
.woocommerce-no-products-found
or.woocommerce-result-count
are overwritten.
We described the product rendering process in detail in our article “Products loading and rendering”.
Key Benefits of In-Browser Filtering
- Many times faster filtering compared to the client-server approach
- High store traffic doesn’t affect filter performance.