REDIS vs FOX
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from icepicknz on December 10, 2024, 16:19We currently use FOX session for currency, when should this be used or not be used? any caveats?
Same for Redis.
Today along with Seraphinite Accelerator for cache we got the site working well and orders 4x normal ROAS. But towards the end of the day orders dropped off.
I noticed some changing currency by dropdown was not working properly and then remembered I had enabled Redis Object Cache again (provides 0.4ms faster page load) so have disabled redis again, but we still having issues with results.So I'd just like to know if redis causes any issues that you are aware of, and if we should use REDIS for currency, and if so why
We currently use FOX session for currency, when should this be used or not be used? any caveats?
Same for Redis.
Today along with Seraphinite Accelerator for cache we got the site working well and orders 4x normal ROAS. But towards the end of the day orders dropped off.
I noticed some changing currency by dropdown was not working properly and then remembered I had enabled Redis Object Cache again (provides 0.4ms faster page load) so have disabled redis again, but we still having issues with results.
So I'd just like to know if redis causes any issues that you are aware of, and if we should use REDIS for currency, and if so why
Quote from icepicknz on December 11, 2024, 02:56we found the setting reverted somehow to transient, putting it back to fox resolved the issue.
I have now re-enabled redis object cache and it appears to be all good.But would still be good to understand if we should be using redis for the currency or if fox session is still the preferred
we found the setting reverted somehow to transient, putting it back to fox resolved the issue.
I have now re-enabled redis object cache and it appears to be all good.
But would still be good to understand if we should be using redis for the currency or if fox session is still the preferred
Quote from Pablo Borysenco on December 11, 2024, 12:35Hello
I recommend using fox session.
The choice of this option depends on the server settings, this setting does not affect the speed in any way. This determines how the currency is stored for the user.
Hello
I recommend using fox session.
The choice of this option depends on the server settings, this setting does not affect the speed in any way. This determines how the currency is stored for the user.
Quote from icepicknz on December 21, 2024, 04:28Thanks,
We are investigating slow queries and see in slow log for mysql
# Query_time: 0.443721 Lock_time: 0.000000 Rows_sent: 59406 Rows_examined: 59406
SET timestamp=1734685527;
SELECT /*!40001 SQL_NO_CACHE */ * FROMwp_woocommerce_sessions;the sessions are being removed after expire as we checked
SELECT COUNT(*) AS expired_sessions
FROM wp_woocommerce_sessions
WHERE session_expiry < UNIX_TIMESTAMP();But wonder why there are 62217 sessions, perhaps from crawlers etc? we have certainly not had this many users in 2 days to our website
Thanks,
We are investigating slow queries and see in slow log for mysql
# Query_time: 0.443721 Lock_time: 0.000000 Rows_sent: 59406 Rows_examined: 59406
SET timestamp=1734685527;
SELECT /*!40001 SQL_NO_CACHE */ * FROM wp_woocommerce_sessions;
the sessions are being removed after expire as we checked
SELECT COUNT(*) AS expired_sessions
FROM wp_woocommerce_sessions
WHERE session_expiry < UNIX_TIMESTAMP();
But wonder why there are 62217 sessions, perhaps from crawlers etc? we have certainly not had this many users in 2 days to our website
Quote from Pablo Borysenco on December 23, 2024, 10:56Hello
These sessions are not only used by my plugin. You can switch to another data storage option, but in any case, a record will be created for each user.
Hello
These sessions are not only used by my plugin. You can switch to another data storage option, but in any case, a record will be created for each user.
Quote from icepicknz on December 23, 2024, 11:15correct, 59000 odd were woocs, the other 3,000 other plugins. I will try redis or something =, just need to make sure the cache works ok
correct, 59000 odd were woocs, the other 3,000 other plugins. I will try redis or something =, just need to make sure the cache works ok
Quote from Pablo Borysenco on December 23, 2024, 13:03Yes it is really strange.
Please try another option and write me the result.
Yes it is really strange.
Please try another option and write me the result.
Quote from icepicknz on December 23, 2024, 13:30the problem I have is when I use redis, the dropdown to select currency, i.e. ?currency=USD does not work; any idea why this breaks?
the problem I have is when I use redis, the dropdown to select currency, i.e. ?currency=USD does not work; any idea why this breaks?
Quote from icepicknz on December 24, 2024, 03:51Please help.
Since using Redis, prices show for users local currency, but when going to checkout page, AUD shows for a brief. time, but then goes to local country currency NZD
please go to https://shop.scanimals.net/index.php/product/test-item/ and test
Fox session worked, but with too many sessions being created I switched to Fox.
Please help.
Since using Redis, prices show for users local currency, but when going to checkout page, AUD shows for a brief. time, but then goes to local country currency NZD
please go to https://shop.scanimals.net/index.php/product/test-item/ and test
Fox session worked, but with too many sessions being created I switched to Fox.
Quote from icepicknz on December 24, 2024, 08:58I had to go back to fox session
is there any issue deleting fox sessions over 2hrs old?
// Schedule a custom job to clean expired WooCommerce sessions.
function schedule_delete_expired_sessions_job() {
if ( ! wp_next_scheduled( 'delete_expired_sessions_hook' ) ) {
wp_schedule_event( time(), 'hourly', 'delete_expired_sessions_hook' );
}
}
add_action( 'wp', 'schedule_delete_expired_sessions_job' );// Define the function that deletes expired WooCommerce sessions.
function delete_expired_sessions() {
global $wpdb;// Set the time threshold (1 hour ago).
$threshold_time = time() - 7200;// Query to delete expired WooCommerce sessions.
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->prefix}woocommerce_sessions
WHERE session_expiry < %d",
$threshold_time
)
);
}
add_action( 'delete_expired_sessions_hook', 'delete_expired_sessions' );// Optionally, remove the scheduled event on plugin/theme deactivation.
function clear_delete_expired_sessions_job() {
$timestamp = wp_next_scheduled( 'delete_expired_sessions_hook' );
if ( $timestamp ) {
wp_unschedule_event( $timestamp, 'delete_expired_sessions_hook' );
}
}
register_deactivation_hook( __FILE__, 'clear_delete_expired_sessions_job' );
I had to go back to fox session
is there any issue deleting fox sessions over 2hrs old?
// Schedule a custom job to clean expired WooCommerce sessions.
function schedule_delete_expired_sessions_job() {
if ( ! wp_next_scheduled( 'delete_expired_sessions_hook' ) ) {
wp_schedule_event( time(), 'hourly', 'delete_expired_sessions_hook' );
}
}
add_action( 'wp', 'schedule_delete_expired_sessions_job' );
// Define the function that deletes expired WooCommerce sessions.
function delete_expired_sessions() {
global $wpdb;
// Set the time threshold (1 hour ago).
$threshold_time = time() - 7200;
// Query to delete expired WooCommerce sessions.
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->prefix}woocommerce_sessions
WHERE session_expiry < %d",
$threshold_time
)
);
}
add_action( 'delete_expired_sessions_hook', 'delete_expired_sessions' );
// Optionally, remove the scheduled event on plugin/theme deactivation.
function clear_delete_expired_sessions_job() {
$timestamp = wp_next_scheduled( 'delete_expired_sessions_hook' );
if ( $timestamp ) {
wp_unschedule_event( $timestamp, 'delete_expired_sessions_hook' );
}
}
register_deactivation_hook( __FILE__, 'clear_delete_expired_sessions_job' );
Quote from Pablo Borysenco on December 24, 2024, 10:58Hello
This looks like correct code.
Hello
This looks like correct code.
Quote from icepicknz on December 24, 2024, 11:00is that ok?
or is there another way that we dont need to set cookie per user, rather we just provide user currency from geo which we do now anyways.
Isn't cookie only for if user changes currency? shouldn't it only set cookie on ?currency= ?
we only allow user to change currency on checkout page with woocs shortcode
is that ok?
or is there another way that we dont need to set cookie per user, rather we just provide user currency from geo which we do now anyways.
Isn't cookie only for if user changes currency? shouldn't it only set cookie on ?currency= ?
we only allow user to change currency on checkout page with woocs shortcode
Quote from Pablo Borysenco on December 24, 2024, 13:02or is there another way that we dont need to set cookie per user, rather we just provide user currency from geo which we do now anyways. - In this case, you need code customization. Because GeoIP only works on the first visit
Isn't cookie only for if user changes currency? - No
shouldn't it only set cookie on ?currency= ? - No
You can shorten your sessions with hooks - wc_session_expiring wc_session_expiration
or is there another way that we dont need to set cookie per user, rather we just provide user currency from geo which we do now anyways. - In this case, you need code customization. Because GeoIP only works on the first visit
Isn't cookie only for if user changes currency? - No
shouldn't it only set cookie on ?currency= ? - No
You can shorten your sessions with hooks - wc_session_expiring wc_session_expiration
Quote from icepicknz on December 24, 2024, 13:16do users need a woocs_current_currency session/cookie if they are in the base currency country?
i.e. if 70% of our users are local we are not doing any currency conversions so there is no need for a session, its only international that need it.
Just trying to work out if there is some performance savings to be added
do users need a woocs_current_currency session/cookie if they are in the base currency country?
i.e. if 70% of our users are local we are not doing any currency conversions so there is no need for a session, its only international that need it.
Just trying to work out if there is some performance savings to be added
Quote from Pablo Borysenco on December 25, 2024, 10:18Hello
do users need a woocs_current_currency session/cookie if they are in the base currency country? - Yes! - https://share.pluginus.net/image/i20241225101839.png
Hello
do users need a woocs_current_currency session/cookie if they are in the base currency country? - Yes! - https://share.pluginus.net/image/i20241225101839.png