Azure Table Storage adapter for catbox
Version | catbox version |
---|---|
6.0.0 | @azure/data-tables |
5.0.0 | @hapi/catbox@11 and azure-storage@2 defined as peer dependencies |
4.0.0 | @hapi/catbox@11 |
3.2.1 | catbox@10 |
Mandatory options:
partition
: the table name of your cache. Defaults tocatbox
ttl_interval
: positive interval in milliseconds at which the GC function will run, passfalse
to disable GC
Other useful options:
connection
: optional connection string or url to Azure Storage. Defaults toUseDevelopmentStorage=true;
credential
: optional azure storage credentialsclient
: optional TableClient instanceallowInsecureConnection
: optional boolean passed to azure TableClient to allow insecure connection
When setting or getting cache-items segment
translates to Azure Table Storage partitionKey
.
Azurite is used for development. Use the shipped docker compose to start or install Azurite via npm.
The default option for connection is set to use the Azure Storage Emulator (v5.10.0.0). This feature must be installed and started to run the tests.
Since Azure Table Storage have no built-in ttl function this functionality will delete expired keys if ttl_interval
is specified.
If ttl_interval
is set to false
the cached entries stored in the table will not be collected even if another catbox-azure-table
client points to the same table.
Due to a limitation in Azure Table Storage only 100 entries can be deleted at one time, per PartitionKey
(segment
). This can cause a problem if there are more than 100 entries created within the ttl_interval
. But probably the GC will catch up eventually.