Backport extractors caching to 1.5, close #1171