Closed
Description
At the moment nedomi stored everything read from the origin. This shouldn't be so. We should only store the cache when the storage says we can. For this to work we will have to make sure storing happens at the right time in the request handling logic. Maybe a request boolean variable (in the request context?) should be used to decide if storing is allowed.
I propose the following flow of the request:
- init request handler
- adding false to the variable "cachable"
- ...some request logic...
- reading the response headers from the origin
- executing the output modules' functions for origin headers and possibly changing the "cachable" variable to true
- only at this point a decision can be made if the origin response can be cached or not