fbpx
  Monday, 15 June 2020
  3 Replies
  3K Visits
  Subscribe
Hi,
please, could you write in this thread the instruction for my developer in order to:

  1. Rebuild a cache for a specific product / offer
  2. Rebuild a cache for all (update); the same function that you call when clicking on CACHE button


By the way, after MongoDB created its indexes, the system became very fast!
3 years ago
·
#4674
"Rebuild entire cache" is always a full rebuild.
3 years ago
·
#4673
Does the "rebuild entire cache" is it always a complete rebuild, or is it a differential?
3 years ago
·
#4672
There is a class
\Sellacious\Cache\Builder\ProductsCacheBuilder


To rebuild entire cache you need to run following code

	$builder = new ProductsCacheBuilder;

$builder->build();



To rebuild cache for specific products you need to run following code. The rebuild method accepts an integer, or an array of integers. Just make sure not to pass many product ids in a single call. Using an array of ~50 products should be fine.

If you have more that 50 products to refresh, you can always call into several chunks of ~50 products in separate calls.

	$builder = new ProductsCacheBuilder;

$pks = 1207; // The numeric product id or an array of numeric product ids

$builder->rebuild($pks);



There are few more functions, which you should usually not require:

	// To delete some of the cache records
$builder->remove($filter);

// To update some fields in the cache records matching a criteria, such as set stock = 100 for seller id = 234 etc.
$builder->update($batch);


If you need more details about these, you can see the code in the file: plugins/system/sellaciouscache/sellaciouscache.php
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
  • +1 (408) 821-8283
  • Email hello@sellacious.com