Support » Plugin: Product Feed PRO for WooCommerce » Bug working with object caching – Redis

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor evavangelooven

    (@evavangelooven)

    Hi samwebdev,

    Thanks for using our plugin and reaching out to us.

    Caching is the main reason our users run into problems with our plugin. I suggest you reach out to the developers of your caching plugin asking how the directories (and files in it) needed to save the product feeds in can be excluded from caching. Once you did I am pretty sure the problem at hand will also be resolved.

    The categories, depending on the file format you selected, are:
    ../wp-content/uploads/woo-product-feed-pro/xml/
    ../wp-content/uploads/woo-product-feed-pro/csv/
    ../wp-content/uploads/woo-product-feed-pro/txt/
    ../wp-content/uploads/woo-product-feed-pro/tsv/

    Hope this helps?

    All the best,
    Eva

    Thread Starter samwebdev

    (@samwebdev)

    Hello eva,

    Thanks for your response.

    The caching plugin is:

    https://wordpress.org/plugins/redis-cache/

    It is not caching any files, so I don’t think it is related to
    ../wp-content/uploads/woo-product-feed-pro/xml/
    ../wp-content/uploads/woo-product-feed-pro/csv/
    ../wp-content/uploads/woo-product-feed-pro/txt/
    ../wp-content/uploads/woo-product-feed-pro/tsv/

    The issue is regarding object caching, most likely how product information and xml process is requested and saved to the database by the plugin.

    Furthermore, the product information do get updated fine with the caching plugin on.

    I think its how the xml process/update is updated by the plugin.

    When the object cache is disabled, the Product Feed plugin do update the process fine. However, when the object cache is enabled, the progress is stuck at 6%, while with each update, the xml file keeps on growing.

    Thread Starter samwebdev

    (@samwebdev)

    Further checking the xml, it looks like the product resume/list that plugin saves and then tries to collect has an issue regarding the way its implemented, when it comes to object caching.

    Please see:

    https://ufile.io/oygfl

    The progress shows about 6% complete.

    After few minutes when we run cron, the file becomes:

    https://ufile.io/q5962

    As you can see, the last 400 products or so keep on repeating and added to xml file, while the progress is stuck at 6%.

    So my take away is, the progress showing 6% is correct, as it has only processed about 6% of all products that are filtered.

    Whats wrong is that the plugin does NOT resume from where its left, so somehow the progress status save/resume is not working along with the object cache.

    Hope you can take a look at how this is saved and retrieved.

    • This reply was modified 2 years, 11 months ago by samwebdev.
    Plugin Contributor evavangelooven

    (@evavangelooven)

    We have installed the Redis object caching plugin and can replicate the issue at hand. So clearly the object caching plugin is causing our plugin to stall.

    Our plugin processes the product feed in batches in order to not cause memory or time-out issues. During this batched process our plugin creates the _tmp version of the XML file and it keeps adding products to the _tmp file until all batches are finished. Only when it is finished it will move the _tmp file to the final file (done so to prevent the XML files being half-filled when Google or any other channel is retrieving it). The object caching plugin is frustrating the batch-process somehow.

    Unfortunately the redis object caching plugin does not come with a lot of explanation as to how it exactly works so we are kind of stuck here.

    Best,
    Eva

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    There is an option to not cache specific caching groups.

    We do use it to not cache user sessions for Woocommerce. Woocommerce definitions are at:

    WC_SESSION_CACHE_GROUP

    class-woocommerce.php 214
    $this->define( ‘WC_SESSION_CACHE_GROUP’, ‘wc_session_id’ );

    class-woocommerce-helper.php 204
    /**
    * Gets a cache prefix. This is used in session names so the entire cache can be invalidated with 1 function call.
    *
    * @return string
    */
    private function get_cache_prefix() {
    return WC_Cache_Helper::get_cache_prefix( WC_SESSION_CACHE_GROUP );
    }

    etc.

    defining this specific cache group to NOT cache:

    define(‘WP_REDIS_IGNORED_GROUPS’, [‘WC_SESSION_CACHE_GROUP’]);

    seems to solve the issue.

    We might try and implement a similar logic for the Product Feed Pro, so the progress etc. will not be cached at the object cache.

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    Any updates on whether the cache group might be implemented to plugin?

    It would most likely solve the issue.

    Regards,
    Sam

    Plugin Contributor evavangelooven

    (@evavangelooven)

    Hi Sam,

    We are currently testing the implementation and are looking for a release on sunday-evening or monday-morning when test show no problems.

    All the best,
    Eva

    Plugin Contributor evavangelooven

    (@evavangelooven)

    Hi Sam,

    We have just pushed out a new version of the plugin, version 4.4.7, could you update the plugin and give it a try?

    Let me know if it solves the issue at hand.

    All the best,
    Eva

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    Thanks for the update.

    We cannot reliably test it, yet.

    In order to test the object cache reliably, we go to cancel feed progress with redis off (there is an issue with this, as it doesn’t work all the time).

    With the feed stopped, enable redis.

    Then try to manually refresh the feed, there is an admin-ajax.php error:

    ;!function(){var t,e,n,o=0,u=function(t,e){return”function”!=typeof t||t.replaced?t:(e.replaced=!0,e)};if(“undefined”!=typeof CustomEvent&&”function”==typeof window.dispatchEvent){var r=function(t){try{if(“object”==typeof t&&(t=JSON.stringify(t)),”string”==typeof t)return window.dispatchEvent(new CustomEvent(“lprequeststart”,{detail:{data:t,requestID:++o}})),o}catch(t){}},s=function(t){try{window.dispatchEvent(new CustomEvent(“lprequestend”,{detail:t}))}catch(t){}};”undefined”!=typeof XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.send&&(XMLHttpRequest.prototype.send=u(XMLHttpRequest.prototype.send,(n=XMLHttpRequest.prototype.send,function(t){var e=this,o=r(t);return o&&e.addEventListener(“loadend”,function(){s({requestID:o,statusCode:e.status})}),n.apply(e,arguments)}))),”function”==typeof fetch&&(fetch=u(fetch,(e=fetch,function(t,n){var o=r(n),u=e.apply(this,arguments);if(o){var c=function(t){s({requestID:o,statusCode:t&&t.status})};u.then(c).catch(c)}return u})));var c=function(t){return u(t,function(){try{this.dispatchEvent(new CustomEvent(“lpsubmit”))}catch(t){}return t.apply(this,arguments)})},i=function(){if(document&&document.forms&&document.forms.length>0)for(var t=0;t<document.forms.length;++t)document.forms[t].submit=c(document.forms[t].submit)};document&&”interactive”===document.readyState||”complete”===document.readyState?i():window.addEventListener(“DOMContentLoaded”,i,!0),Document.prototype.createElement=u(Document.prototype.createElement,(t=Document.prototype.createElement,function(){var e=t.apply(this,arguments);return e&&”FORM”===e.nodeName&&e.submit&&(e.submit=c(e.submit)),e}))}}();

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    I guess the initial redis object cache version is rolled back; any info on when/how to solve the issue?

    Sincerely,

    Sam

    Plugin Contributor evavangelooven

    (@evavangelooven)

    Hi Sam,

    You are quick to notice. Yes we rolled it back earlier today as we got complaints from some users that it broke the plugin/WooCommerce. We quit thoroughly tested before putting it live and did not run into any issue on our test instances but unfortunately it seems the solution was not as simple as we initially thought.

    We will continue investigating what happened but for now it is out yes.

    Best,
    Eva

    Plugin Contributor evavangelooven

    (@evavangelooven)

    I am sorry to report that we do not get to seem the Redis Caching support to work properly. We have decided to not continue as it is taking too much time for too little users who actually need it.

    All the best,
    Eva

    Thread Starter samwebdev

    (@samwebdev)

    Hello Eva,

    Did you get a chance to check Cache Groups?

    Regards,

    Sam

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Bug working with object caching – Redis’ is closed to new replies.