I am loading around 40,000 searchable entries in a select2 and it takes a long time to load. Is there any way of dumping the dataset to a faster source such as memcache or redis in order to massively improve loading of the select2 on search?
I am loading around 40,000 searchable entries in a select2 and it takes a long time to load. Is there any way of dumping the dataset to a faster source such as memcache or redis in order to massively improve loading of the select2 on search?
You can try the Transient API
$my_data = array(
1,2,3,4,5
//.....
1000000
);
set_site_transient( 'my_transient_data', $my_data, 100000 );
// 100000 is the expiration date(in seconds)..
// Get array....
get_site_transient('my_transient_data' );
// Delete the Transient...
delete_site_transient( 'my_transient_data' );