Todd Hubers

My feedback

  1. 965 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Todd Hubers commented  · 

    While it's an interesting idea, I disagree.

    Second level cache isn't a one-size-fits-all solution. I've seen EFCache used in the past and there needs to be much more research before this is attempted - if at all. In the current world of Web and JSON RESTful webservices, [OutputCaching] attribute is preferable in my opinion, caching not only the database data, but also the serialized form. But that's all subject to the different projects, people, customers and decisions made. This is probably why EF doesn't have it built in, it's not THE solution.

    The biggest problem with caching is expiry. Whereas single-level cache concerns single discrete objects from a repository, and lifetime associated with the datacontext, complex queries span multiple repositories and can have a long lifetime and hence no automatic expiry mechanism. With second-level cache the software engineer needs to notify when to expire.

    If you have a query return a list of Book Titles that are overdue, the results can be affected by two things: Returning of the Book, and Change of Book Title. But that's a simple example.

Feedback and Knowledge Base