For the complete documentation index, see llms.txt. This page is also available as Markdown.

Code Usage

Learn how to use the Couchbase cache provider in your BoxLang applications using the standard cache functions.

Learn how to use the Couchbase cache provider in your BoxLang applications using the standard cache functions.

🎯 Cache Configuration

Configure Couchbase as a cache provider in your Application.bx:

this.caches["default"] = {
    "provider": "Couchbase",
    "properties": {
        "connectionString": "couchbase://localhost",
        "username": "Administrator",
        "password": "password",
        "bucket": "myapp",
        "scope": "_default",
        "collection": "_default"
    }
};

📝 Basic Operations

Setting Cache Values

Getting Cache Values

Checking Existence

Deleting Cache Values

🔍 Advanced Operations

Get Multiple Keys

Get All Keys

Get Cache Metadata

🎨 Patterns and Best Practices

Cache-Aside Pattern

Namespace Your Keys

Handle Cache Failures Gracefully

Use Appropriate TTLs

🔄 Integration with Query Caching

🎯 Working with Scopes

Couchbase supports scopes and collections for logical data organization:

📊 Performance Tips

Batch Operations

Connection Pooling

Connection pooling is automatic! The module manages connections efficiently behind the scenes.

Monitor Cache Performance

🐛 Debugging

Enable debug logging in your boxlang.json:

🔗 Next Steps

  • API Usage - Learn about the Built-In Functions

  • Scope Storage - Use Couchbase for sessions

  • AI Memory - Explore vector search capabilities

Last updated

Was this helpful?