Input cache helps reducing page speed loads since it avoids to have visitors waiting for the server to do necesary requests to data server or file reads in order to get all the data it needs to render the output. This behavior consist in saving every needed input in a temporary memory in order to be reused if they are needed before a predefined amount of time has passed.
st=>start: Dataset fetch call
datasetCached=>condition: dataset cached?
apiRequest=>inputoutput: API request
save=>subroutine: save result in cache:
API_CACHE_TIME_TO_LIVE
e=>end: Return dataset
st->datasetCached(yes)->e
st->datasetCached(no)->apiRequest
apiRequest(right)->save->e
st=>start: File content request
fileCached=>condition: content cached?
apiRequest=>inputoutput: File is read
save=>subroutine: save content in cache:
FILE_CACHE_TIME_TO_LIVE
e=>end: Return content
st->fileCached(yes)->e
st->fileCached(no)->apiRequest
apiRequest(right)->save->e
Once a specific page has been processed, the outputed content is also cached in order to avoid unnecesary CPU process. This means that subsecuent calls to the controller will output its content directly and will not execute any code from that controller if it was called with exact same parameters.
st=>start: Page request
outputCached=>condition: output cached?
apiRequest=>inputoutput: Controller is ran
save=>subroutine: save output in cache:
OUTPUT_CACHE_TIME_TO_LIVE
e=>end: Output content
st->outputCached(yes)->e
st->outputCached(no)->apiRequest
apiRequest(right)->save->e