Caching and headers |
[eluser]narkaT[/eluser]
[quote author="Arjen van Bochoven" date="1226978818"]I've spoken too soon, I forgot Call-time pass-by-reference" is deprecated, so to make this work we have to change the function definition of _display()[/quote] you're right. I wonder why my tests not triggered any warnings, I used a "recent php version" for that. the manual says that a warning message should have been generated. [quote author="Arjen van Bochoven" date="1226978818"]I don’t know if adding the ref is breaking something (php4, anybody?)[/quote] I've found some interesting comment in the manual. taking that into account the following would not work for php4 Code: function _display(&$output = '') tricky... :roll:
[eluser]Henry Weismann[/eluser]
This is exactly what I was looking for! I am building my applications to load views in a css view folder and output it as css after minimizing it and dynamically setting expire headers. In the end it makes one nice cached, minimized css file and a single http request. I did the same for JavaScript. Does anybody know if I can set it to be gzipped as well and how that will interact with caching?
[eluser]Arjen van Bochoven[/eluser]
[quote author="hcamelion" date="1227005591"]Does anybody know if I can set it to be gzipped as well and how that will interact with caching?[/quote] If you set Code: $config['compress_output'] = TRUE;
[eluser]Aquillyne[/eluser]
[quote author="hcamelion" date="1227005591"]This is exactly what I was looking for! I am building my applications to load views in a css view folder and output it as css after minimizing it and dynamically setting expire headers. In the end it makes one nice cached, minimized css file and a single http request. I did the same for JavaScript. Does anybody know if I can set it to be gzipped as well and how that will interact with caching?[/quote] Would you mind sharing your code for the CSS minimization, and your javascript view??
[eluser]Phil Sturgeon[/eluser]
Time for a little resurrection. I posted here pointing out a few of my concerns with this header caching method. It is clearly an improvement over the core Output library, but it still has a little way to go until it is perfectly usable in all situations. Perhaps storing the Content type header as part of the md5 hash would be an idea?
[eluser]pacifika[/eluser]
Thanks this is very useful to me, I am parsing an external page then retrieving content of an image on that page, now I can cache the image content and serve it without issues.
[eluser]vrencianz[/eluser]
This thread is old but the MY_Output class is still useful. For Codeigniter 2.1.0 this override neds only few mods: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Welcome Guest, Not a member yet? Register Sign In |