Improved output caching with headers #1337

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

Contributor
  • Output the old headers as well. (Handy for picky browsers (Chrome) that complain when content-type doesn't match, e.g. when rendering JS with views)
@aphofstede aphofstede * Sane cache saving and loading using serialize
* Output the old headers as well. (Handy for picky browsers (Chrome) that complain when content-type doesn't match, e.g. when rendering JS with views)
1268ad1
Contributor
cryode commented Oct 13, 2012

Skipping over the headers aspect of this for a second - using serialize() dramatically improves the performance of the Output class' caching (at least for the rough testing I did locally - in some cases by 50% or more). I don't know how much impact saving the headers has (it seems like a good addition), but anything that improves cache performance should definitely be added.

Edit -- I duplicated a single page on a production server that I'm currently using the cache driver for (file-based) and it did not produce as promising of results. The file cache driver performed the worst (good to know, I'll be changing that), followed by this updated mode with serialize(), and the standard output cache was the fastest. The serialize() version was a bit inconsistent, occasionally with times on par with the output cache, other times slightly higher. I'd have to do a lot more tinkering to see what can be improved both in my application and with CI, but definitely something to still look into.

Contributor
narfbg commented Oct 18, 2012

Headers will be sent by _display() anyway and with @cryode's notes - this seemed to be the only real improvement here. Closing.

@narfbg narfbg closed this Oct 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment