Review main Abandoned

18289[FEATURE] Simple cache for fileIndexRecords in FileRepository

Stefan Neufeind CR 0 V 0 Easy +35 −0 updated 06/03/13, 20:49

Commit message

In FileRepository identical calls to getFileIndexRecord()
can benefit from a simple cache.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 7

  1. Dmitry Dulepov commented on patch set 1 04/05/13, 22:51

    A runtime cache with caching framework can be a better implementation.
  2. Stefan Neufeind commented on patch set 1 04/05/13, 22:51

    (2 inline comments) @Steffen: I expected the repository would be used as a central place (one instance per storage-repository). What I was faced with was a list of icons where the same entry was fetched over and over again, that's why I thought we might want to cache things. Invalidation, as I planned and did in the patch, would be done in the repository itself. If of course you think there might be other ways to manipulate a file which we don't catch this was, then we're in trouble. I expected the add/update-functions here would be a central place to update something in a repo. Suggestions/help welcome ...
  3. Stefan Neufeind commented on patch set 1 04/05/13, 22:51

    @Dmitry: I agree using the cachingFramework here we'd be better of. For me however the question Steffen raised remains if this approach to fix and cache things itself is good/correct/... We can imho then easily swap how the caching is done exactly.
  4. Steffen Ritter commented on patch set 1 04/05/13, 22:51

    I would prefer that you didn't submit this Hi, I'm not sure if this helps or just is a big source of bugs... Who invalidates the cache... The fileRepository is not a singleton. So several instances may cache the same record - in different versions if altered in the meantime... As Philip says: you do not consider a file used hundreds of times where this could hurt... If caching is implemented it should be at a lower level...
  5. Philipp Gampe commented on patch set 1 04/05/13, 22:51

    (2 inline comments) How likely is it that the same file is used multiple times.

    FileRepository.php:116

    this serialize looks bit costly ... why not $storageUid . $indentifier

    FileRepository.php:118

    This early return is now pretty ugly.
  6. Mr. Jenkins commented on patch set 1 04/05/13, 22:51

  7. Steffen Ritter commented on patch set 1 04/05/13, 22:51

    Abandoned won't fix for now