Complete the code to apply the cache decorator to the method.
@[1]() getData() { return 'data'; }
The @Cacheable() decorator marks the method to use caching.
Complete the code to set a custom cache key for the method.
@Cacheable() @[1]('custom_key') fetchItems() { return ['item1', 'item2']; }
The @CacheKey('custom_key') decorator sets a custom key for caching.
Fix the error in the code to set cache time-to-live (TTL) correctly.
@Cacheable() @[1](3000) getUsers() { return ['user1', 'user2']; }
The @CacheTTL(3000) decorator sets the cache expiration time in seconds.
Fill both blanks to apply caching with a custom key and TTL.
@Cacheable() @[1]('session_data') @[2](600) getSession() { return { id: 1, user: 'Alice' }; }
@CacheKey('session_data') sets the cache key, and @CacheTTL(600) sets the cache duration.
Fill all three blanks to create a cached method with a custom key, TTL, and global cache config.
@[1]() @[2]('profile_cache') @[3](1200) fetchProfile() { return { name: 'Bob', age: 30 }; }
@Cacheable() enables caching, @CacheKey('profile_cache') sets the key, and @CacheTTL(1200) sets the cache duration.
