DescriptionSlightly modifies AbstractSpecFactory behavior to avoid caching GadgetException in the (local) spec cache when the RequestPipeline returns a non-SC_OK result.
Rationale: A RequestPipeline may serve the same spec in two different ways (namely, OK vs. not-OK) depending on additional request context, such as the user's IP or other contextual information. It will similarly perform its own HttpCaching logic, in particular performing negative caching for non-OK results. Caching exceptions in the spec cache has the main value of avoiding re-parsing of known-faulty specs. Caching a fetch exception is simply duplicative of the HttpCache's spec while making subtle RequestPipeline-focused logic more difficult to implement. As such, I'm removing this caching behavior.
Test added to DefaultGadgetSpecFactoryTest for simplicity. Turns out one test in it was misnamed anyway, so was repurposed.
Patch Set 1 #Patch Set 2 : Tweaking the test a bit. #
MessagesTotal messages: 2
|