• Resolved samwebdev

    (@samwebdev)


    Hello Eva,

    Until the cache group is implemented to the plugin, you could add these before the wp_schedule_single_event:

    wp_cache_flush();

    possible lines:

    /wp-content/plugins/woo-product-feed-pro/woocommerce-sea.php
    line 1090

    /wp-content/plugins/woo-product-feed-pro/classes/class-get-products.php
    line 2020
    line 2557

    wp_schedule_single_event seems to be updating the options table for the products processed and feed progress, and the logic is clearing the object cache. It would clear the whole object cache – at least until the cache group is added – but will get the Product Feed plugin to work with any object cache.

    If there are any other places that updates products/progress/etc. please feel free to add the wp_cache_flush();

    Looking forward to your take on this; if possible please add it to the next release. We have been testing it for about a week now without any issues, currently have to add it back again for each update released.

    Regards,

    Sam

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Sam,

    We have just pushed out a new release containing the flushing rules. Can you update the plugin and give it a try?

    All the best
    Eva

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    It works, thanks.

    Please also work on the cache group feature, it should solve the cache issue for all.

    Thanks,

    Sam

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    In order to update the processing, its best to add these to 2 more lines:

    woocommerce-sea.php

    function woosea_continue_batch($project_hash){
    wp_cache_flush();

    around line 2644

    class-get-products.php

    public function woosea_project_update($project_hash, $offset_step_size){
    wp_cache_flush();

    around line line 2493

    Thanks

    Thanks again Sam!

    We have just pushed out a new release, version 4.8.8, that contains the extra cache flushes.

    All the best
    Eva

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    Thanks just downloaded the new version.

    One question though:

    If you implement cache flush after the feed is requested, you may get the old data from database:

    $feed_config = get_option( 'cron_projects' );
     $nr_projects = count ($feed_config);
    	
     // Flush caching
     wp_cache_flush();

    Could you move the

    // Flush caching
    wp_cache_flush();

    lines right after the functions, line 2645 and 2491 respectively:

    	public function woosea_project_update($project_hash, $offset_step_size){
    		// Flush caching
    		wp_cache_flush();
    
    		$feed_config = get_option( 'cron_projects' );
    		$nr_projects = count ($feed_config);

    and

    function woosea_continue_batch($project_hash){
    	// Flush caching
    	wp_cache_flush();
    
        $batch_project = "batch_project_".$project_hash;
    	$val = get_option( $batch_project );

    Thanks

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    It looks like every project/product update/refresh needs to be flushed.

    It might be better to add the flush to constructor (if any); if not these functions seem to require a cache flush:

    function woosea_project_delete(){
    function woosea_project_processing_status(){
    function woosea_project_copy(){
    function woosea_project_refresh(){
    function woosea_project_status() {
    function woosea_update_project_history($project_hash){
    function woosea_create_all_feeds(){
    function woosea_nr_products($project_hash, $nr_products){
    function woosea_last_updated($project_hash){
    function woosea_continue_batch($project_hash){

    I will keep testing it with

    function woosea_continue_batch($project_hash){
    // Flush caching
    wp_cache_flush();

    ..

    for multiple exports with more than 25K products, and update it here.

    If you can please also test it on your side (with Redis and/or any other object cache installed).

    Changing the status of the ticket to unresolved in the mean time.

    Regards,

    Sam

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Object Cache Enhancement: could be used until cache group is implemented’ is closed to new replies.