Cache the libraries directory so that the file system doesn't have to be scanned on each page call.

CommentFileSizeAuthor
cachethisshit.patch4.3 KBRobLoach
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobLoach’s picture

Project: Library » Libraries API
Version: 6.x-1.x-dev »

Uhh, wrong project. lol.

sun’s picture

Can we move this over to #466090: Scan: Cache results ?

tstoeckler’s picture

Version: » 7.x-1.x-dev
Status: Needs review » Closed (duplicate)

I think now that #719896: Add a hook_libraries_info() is in, it doesn't make sense to only cache the directories, but concentrate on caching the whole library information over in #466090: Scan: Cache results.

Please re-open if you feel differently.

tstoeckler’s picture

Status: Closed (duplicate) » Active

Hmmm... #466090: Scan: Cache results is good for the DB cache. But when that is cleared, you're going to end up calling libraries_get_path() possibly a bunch of times on the next page load. So I think we should do static caching in libraries_get_libraries(). Re-opening.

tstoeckler’s picture

Status: Active » Fixed
  static $libraries;

  if (!isset($libraries)) {
    $libraries = libraries_get_libraries();
  }

Ehhh.... right. I'm actually pretty much a static-caching noob, but I now that I've found this (...), I don't think there's anything we can do.
(Right?)

Marking fixed, because the new issue statuses scare me. :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.