Caching basics — Questions & Answers

Test your understanding of caching fundamentals for inference results, including cache keys, model versions, time-to-live (TTL), and differences between client-side and server-side caching. This easy quiz will help reinforce best practices and key concepts in caching strategies.

This quiz contains 15 questions. Below is a complete reference of all questions, answer choices, and correct answers. You can use this section to review after taking the interactive quiz above.

  1. Question 1: Basic definition of caching

    What is the main purpose of caching inference results in an application?

    • To permanently delete obsolete data
    • To encrypt all data before transmission
    • To store previously computed outputs for faster future access
    • To sequence data requests alphabetically
    Show correct answer

    Correct answer: To store previously computed outputs for faster future access

  2. Question 2: Cache key components

    Which of the following elements should typically be included in a cache key for model inference results?

    • Just the server IP address
    • Only the current date
    • Randomly generated numbers
    • Model name and version, input data, and user identifier
    Show correct answer

    Correct answer: Model name and version, input data, and user identifier

  3. Question 3: Effect of model versioning

    If a cache key does not include the model version, what might happen when the model is updated?

    • The cache will automatically reset
    • Old results may be falsely returned for new model versions
    • Cache will stop storing any data
    • All computation results will double in speed
    Show correct answer

    Correct answer: Old results may be falsely returned for new model versions

  4. Question 4: Understanding TTL

    What does TTL (Time To Live) refer to in caching for inference results?

    • The maximum duration a cached result is considered valid
    • The timestamp of the last server reboot
    • The size limit for cache entries
    • Total transfer latency for input data
    Show correct answer

    Correct answer: The maximum duration a cached result is considered valid

  5. Question 5: Cache refresh mechanism

    When the TTL for a cached result expires, what typically happens?

    • It gets encrypted again
    • The cached entry is invalidated and recomputed if needed
    • The cache entry is silently ignored forever
    • It turns into permanent storage
    Show correct answer

    Correct answer: The cached entry is invalidated and recomputed if needed

  6. Question 6: Client-side caching scenario

    If a web browser stores inference results locally, what type of caching is this?

    • Database replication
    • Server-based caching
    • Client-side caching
    • Global cache synchronization
    Show correct answer

    Correct answer: Client-side caching

  7. Question 7: Server-side caching definition

    What describes server-side caching in the context of inference results?

    • Results are synced through USB drives
    • Cache is kept only on the user's personal device
    • Results are stored on the application server for all clients
    • Each device stores its own results
    Show correct answer

    Correct answer: Results are stored on the application server for all clients

  8. Question 8: Unique cache keys per request

    Why is it important to ensure cache keys are unique for different requests?

    • To use more server memory
    • To prevent returning incorrect results from unrelated inputs
    • To increase TTL automatically
    • To guarantee higher network latency
    Show correct answer

    Correct answer: To prevent returning incorrect results from unrelated inputs

  9. Question 9: Impact of omitting input data from cache keys

    If the input data is not part of a cache key, what issue can occur?

    • TTL will not function properly
    • The cache will never be accessed
    • Different inputs may incorrectly share the same cached result
    • The server will crash instantly
    Show correct answer

    Correct answer: Different inputs may incorrectly share the same cached result

  10. Question 10: Appropriate TTL setting

    Which TTL value would be most appropriate for frequently changing inference models?

    • A TTL of 5 years
    • An unlimited TTL
    • A shorter TTL, such as 1-5 minutes
    • No TTL at all
    Show correct answer

    Correct answer: A shorter TTL, such as 1-5 minutes

  11. Question 11: Cache hit versus miss

    What is a cache hit in the context of inference result caching?

    • When the user refreshes their browser
    • When a requested inference result is found in the cache and returned
    • When the cache is too full to store results
    • When two clients exchange cache entries
    Show correct answer

    Correct answer: When a requested inference result is found in the cache and returned

  12. Question 12: Best practices for cache invalidation

    Which action is a best practice for invalidating cached inference results when a model is updated?

    • Shorten input data
    • Disable caching for all users
    • Change the model version included in the cache key
    • Increase the cache storage size
    Show correct answer

    Correct answer: Change the model version included in the cache key

  13. Question 13: Reducing redundant computation

    How does proper caching of inference results help reduce redundant computations?

    • By always recalculating outputs every time
    • By serving duplicate requests from cached data instead of re-computing
    • By limiting the number of API requests
    • By randomly dropping requests
    Show correct answer

    Correct answer: By serving duplicate requests from cached data instead of re-computing

  14. Question 14: Choosing between cache locations

    Which is an advantage of server-side caching over client-side caching for inference results?

    • Server-side caching allows results to be shared among multiple users
    • Server-side cache has no storage limitations
    • Server caches can only be used on mobile devices
    • Only the client can access cached data
    Show correct answer

    Correct answer: Server-side caching allows results to be shared among multiple users

  15. Question 15: Risks of stale cache

    What is a potential risk of having an excessively long TTL on cached inference results?

    • Clients may receive outdated or incorrect results
    • Input data will be randomly altered
    • Network connections become unstable
    • All inference models will crash
    Show correct answer

    Correct answer: Clients may receive outdated or incorrect results