Forums » Plugin: Auto Amazon Links - Amazon Associates Affiliate Plugin » HOw reduce cache size of wp_aal_request_cache

  • My web host notified me that my database size is too big.

    I checked and there is one table created by your plugin which accounts for 95% of our entire database size!

    The size of wp_aal_request_cache is 823MB for about 250 products.

    Is there something I can do to manage this cache?

    I’d like to keep the whole database under 700 MB.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    There is no setting to give a maximum allowed database table size with this plugin. However, you can set an interval to remove expired caches by going to Dashboard -> Amazon Auto Links -> Settings -> Cache -> Interval for Removing Expired Caches. Maybe you want to set it to 1 day or something.

    Hope this helps.

    Thread Starter Joanne

    (@bluejpro)

    Thank you @miunosoft – Removing expired caches helped bring the total database size under the limit

    Thread Starter Joanne

    (@bluejpro)

    Thank you also for directing me to the ‘caches’ option in the settings.

    Your advice was just what I needed.

    One more question: I see these two settings for ‘caching mode’
    Normal – relies on WP Cron to renew caches.
    Intense – relies on the plugin caching method to renew caches.

    Do you recommend leaving it at Normal? I’m a little wary about choosing something labelled ‘intense’ for the table size issue.

    Plugin Author miunosoft

    (@miunosoft)

    Glad to hear it helped!

    As for the other question, unless you see caches not being renewed, you don’t need to set it to Intense. In most cases, Normal would be fine. It is for some sites that have problems with the WP Cron API.

    Thread Starter Joanne

    (@bluejpro)

    Hello @munisoft

    The Request caches are now going over the size limit.

    We have a size limit of 1000MB and that is the cache size.

    I would like to avoid having to manually reset caches. (My customer keeps getting warnings from our host about exceeding our resource limits and we have already upgraded to more hosting than otherwise needed to help accommodate the plugin.)

    Does the pro version allow you to set a cache size cap?

    Plugin Author miunosoft

    (@miunosoft)

    Hi,

    Pro does not have such an option either.

    What value do you set for the Interval for Removing Expired Caches option? If you set one hour and then get 10000MB of cache size, it is unusual. In that case, it could be that WP Cron is disabled by the host. If so, enable the Intense caching mode.

    Thread Starter Joanne

    (@bluejpro)

    It is set to Intense 🙂

    Thread Starter Joanne

    (@bluejpro)

    Hello
    Today the size of our wp_aal_request_cache is 1101.29 mB
    That’s right it is 1.1 GB.

    I have had the caching mode set to intense and the interval for removing expired caches set to 1 day for the past month.

    I am wondering if the function to remove expired caches is actually working.

    Here is the data from the Caches tab:
    Caches

    Sizes
    Products: 17.06 MB
    Requests: 1101.29 MB

    Products: 113 item(s).
    Requests: 877 item(s).

    Clear Expired Caches
    Products: 0 item(s).

    Requests: 7146 item(s).

    The goal is to have the plugin remove caches well before they get to 1GB. Maybe half that at the most.

    Can your plugin confirm when it has deleted expired caches so we know if this function is operational?

    Thread Starter Joanne

    (@bluejpro)

    Where in the directory does your plugin store this cache? Maybe I can delete the file with a custom cronjob.

    Please advise

    Plugin Author miunosoft

    (@miunosoft)

    Can your plugin confirm when it has deleted expired caches so we know if this function is operational?

    You can use a plugin called WP Control (https://wordpress.org/plugins/wp-crontrol/) to check if WP Cron tasks are run properly. The hook name you want to find is aal_action_delete_expired_caches which should be listed in the UI of WP Control. It also gives the scheduled time. So you can see whether it runs or not.

    Where in the directory does your plugin store this cache? Maybe I can delete the file with a custom cronjob.

    The plugin stores those caches in the MySQL database using a custom table name. The names are aal_products and aal_request_cache. If you can code PHP, the plugin has a method to do the expired-cache removal task: AmazonAutoLinks_PluginUtility::deleteExpiredTableItems().

    Thread Starter Joanne

    (@bluejpro)

    Thanks for the feedback. i may try a custom MySQL job to truncate the table once per week. Unless you see a reason not to do that.

    hello!

    same prroblem on my side, and it’s not the expired part which is the biggest. Over 800MB vs 200MB of expired.

    and cache celasning is set to … 1 hour

    any suggestion ? better to have this cleaning period low or high ?

    (my unit have a cache of 86400)

    • This reply was modified 6 years, 2 months ago by photoaixmars.
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘HOw reduce cache size of wp_aal_request_cache’ is closed to new replies.