Welcome Guest, Not a member yet? Register   Sign In
Caching and headers
#49

[eluser]Randy Casburn[/eluser]
Please consider both of these quotes...

Quote:it is organizationally advantageous for both the user and the developer to have the same controller/method pushed to a variety of formats rather than a loose collection of URLs to do the same

AND

Quote:If the suffix is recognised then I can get a separate cache for foo.css and foo.js. Fantastic. But still, neither of them, when the cache is delivered, will be accompanied by their respective “text/css” and “text/javascript” headers. That’s the issue I’m trying to address. Regardless of how the cache grabs the URI, subsequent returns of the cache don’t also return the appropriate headers.


These sound like "my way or the highway" types of language. I mean really. The first, while it may be true or not, sounds like "one view of the world". Someone else may have a different view. That makes it an "implementation". That makes that reasoning a little weak because not everyone will "implement" that way. Perhaps that's why there is debate about it.(?) The second quote is simply "I refuse to listen to the fact that I can have any impact on you "because I don't see it that way". And that is simply wrong headed IMHO.

Now to be fair...

Quote:Sure, I’ll go on the record and agree with you in that statement for sure.

AND

Well, this is where we part company. I agree you are not creating ERRORS, but you are COMPOUNDING difficulties by making them more apparent.

The first quote I said about the solution not being anything funky. The second quote I said about the solution too.

==========

Can I encourage us to restructure our thinking on the entire issue?

==========

Let's call this:

CI MIME type caching.

Possible Help Documentation
---------------------------
By default, when caching is turned on, CI will cache your output as type text/html.

Simultaneous caching of other MIME types is also supported. This would allow you to maintain a long term cache of one file while periodically updating other files without the need to update your entire cache. As an example, you may send dynamic CSS from a View file and have that CSS saved to a cache. The CSS cache file may rarely change. The CSS styles may apply to an HTML View file that is saved to a separate cache file that can change independently of the CSS cache. This could also apply to a separate JavaScript file built from a View file and saved independently to a separate cache file. Now if you edit your JavaScript View content the only the JavaScript cache will require a refresh while the other cache files will remain untouched.

To implement this you will be required to use the Ouput class' set_header() function to ensure that you set the correct mime type header for the file type that will be cached.

For example:

Code:
[ controller ]

$data["body"] = array("background" => "white");
$this->output->set_header("Content-Type: text/css");
$this->load->view("styles/css_file", $data)

[ view ]

body {
   background: white
}

===========================

Now, let's figure out a way to have CI provide this functionality. Forget everything you already know about how to do this. OK, that's probably unrealistic. But we can do this with out all that other "my way or the highway stuff" right?

@Derek(s) -- Don't you think this would be good for CI?

Randy


Messages In This Thread
Caching and headers - by El Forum - 07-10-2008, 11:38 PM
Caching and headers - by El Forum - 07-11-2008, 05:16 AM
Caching and headers - by El Forum - 07-11-2008, 09:07 AM
Caching and headers - by El Forum - 07-11-2008, 11:34 AM
Caching and headers - by El Forum - 07-11-2008, 12:58 PM
Caching and headers - by El Forum - 07-11-2008, 03:08 PM
Caching and headers - by El Forum - 07-11-2008, 10:38 PM
Caching and headers - by El Forum - 07-11-2008, 10:44 PM
Caching and headers - by El Forum - 07-12-2008, 12:17 AM
Caching and headers - by El Forum - 07-12-2008, 12:21 AM
Caching and headers - by El Forum - 07-12-2008, 12:44 PM
Caching and headers - by El Forum - 07-20-2008, 10:00 PM
Caching and headers - by El Forum - 07-20-2008, 10:30 PM
Caching and headers - by El Forum - 07-20-2008, 10:31 PM
Caching and headers - by El Forum - 07-20-2008, 11:52 PM
Caching and headers - by El Forum - 07-20-2008, 11:54 PM
Caching and headers - by El Forum - 07-21-2008, 05:25 AM
Caching and headers - by El Forum - 07-21-2008, 10:07 AM
Caching and headers - by El Forum - 07-21-2008, 11:47 AM
Caching and headers - by El Forum - 07-21-2008, 03:19 PM
Caching and headers - by El Forum - 07-21-2008, 03:58 PM
Caching and headers - by El Forum - 07-21-2008, 04:21 PM
Caching and headers - by El Forum - 07-21-2008, 05:31 PM
Caching and headers - by El Forum - 07-21-2008, 06:46 PM
Caching and headers - by El Forum - 07-21-2008, 07:02 PM
Caching and headers - by El Forum - 07-21-2008, 07:11 PM
Caching and headers - by El Forum - 07-21-2008, 07:29 PM
Caching and headers - by El Forum - 07-21-2008, 07:39 PM
Caching and headers - by El Forum - 07-21-2008, 08:49 PM
Caching and headers - by El Forum - 07-21-2008, 08:55 PM
Caching and headers - by El Forum - 07-21-2008, 10:01 PM
Caching and headers - by El Forum - 07-21-2008, 10:11 PM
Caching and headers - by El Forum - 07-21-2008, 10:15 PM
Caching and headers - by El Forum - 07-21-2008, 10:22 PM
Caching and headers - by El Forum - 07-21-2008, 10:28 PM
Caching and headers - by El Forum - 07-21-2008, 10:36 PM
Caching and headers - by El Forum - 07-21-2008, 10:37 PM
Caching and headers - by El Forum - 07-21-2008, 10:40 PM
Caching and headers - by El Forum - 07-21-2008, 11:26 PM
Caching and headers - by El Forum - 07-22-2008, 10:12 AM
Caching and headers - by El Forum - 07-22-2008, 10:26 AM
Caching and headers - by El Forum - 07-22-2008, 12:21 PM
Caching and headers - by El Forum - 07-22-2008, 01:01 PM
Caching and headers - by El Forum - 07-22-2008, 01:09 PM
Caching and headers - by El Forum - 07-22-2008, 01:14 PM
Caching and headers - by El Forum - 07-22-2008, 01:37 PM
Caching and headers - by El Forum - 07-22-2008, 01:44 PM
Caching and headers - by El Forum - 07-22-2008, 03:39 PM
Caching and headers - by El Forum - 07-22-2008, 03:42 PM
Caching and headers - by El Forum - 07-22-2008, 03:43 PM
Caching and headers - by El Forum - 07-22-2008, 03:49 PM
Caching and headers - by El Forum - 07-22-2008, 04:08 PM
Caching and headers - by El Forum - 07-22-2008, 04:31 PM
Caching and headers - by El Forum - 07-22-2008, 04:45 PM
Caching and headers - by El Forum - 07-22-2008, 04:47 PM
Caching and headers - by El Forum - 07-22-2008, 04:59 PM
Caching and headers - by El Forum - 07-22-2008, 05:49 PM
Caching and headers - by El Forum - 07-22-2008, 06:58 PM
Caching and headers - by El Forum - 07-22-2008, 06:59 PM
Caching and headers - by El Forum - 07-22-2008, 07:30 PM
Caching and headers - by El Forum - 07-22-2008, 08:08 PM
Caching and headers - by El Forum - 07-22-2008, 08:58 PM
Caching and headers - by El Forum - 07-22-2008, 08:59 PM
Caching and headers - by El Forum - 10-27-2008, 03:55 AM
Caching and headers - by El Forum - 10-27-2008, 10:33 AM
Caching and headers - by El Forum - 10-27-2008, 11:55 AM
Caching and headers - by El Forum - 11-11-2008, 03:59 AM
Caching and headers - by El Forum - 11-11-2008, 05:29 AM
Caching and headers - by El Forum - 11-11-2008, 06:08 AM
Caching and headers - by El Forum - 11-11-2008, 01:12 PM
Caching and headers - by El Forum - 11-12-2008, 12:11 AM
Caching and headers - by El Forum - 11-12-2008, 03:25 AM
Caching and headers - by El Forum - 11-12-2008, 04:28 AM
Caching and headers - by El Forum - 11-12-2008, 04:45 AM
Caching and headers - by El Forum - 11-12-2008, 06:48 AM
Caching and headers - by El Forum - 11-12-2008, 07:22 AM
Caching and headers - by El Forum - 11-12-2008, 07:55 AM
Caching and headers - by El Forum - 11-12-2008, 10:44 AM
Caching and headers - by El Forum - 11-13-2008, 03:23 AM
Caching and headers - by El Forum - 11-13-2008, 04:48 AM
Caching and headers - by El Forum - 11-13-2008, 05:17 AM
Caching and headers - by El Forum - 11-13-2008, 05:41 AM
Caching and headers - by El Forum - 11-13-2008, 12:17 PM
Caching and headers - by El Forum - 11-13-2008, 12:27 PM
Caching and headers - by El Forum - 11-13-2008, 12:34 PM
Caching and headers - by El Forum - 11-17-2008, 03:12 AM
Caching and headers - by El Forum - 11-17-2008, 05:01 AM
Caching and headers - by El Forum - 11-17-2008, 07:32 AM
Caching and headers - by El Forum - 11-17-2008, 07:57 AM
Caching and headers - by El Forum - 11-17-2008, 03:26 PM
Caching and headers - by El Forum - 11-17-2008, 03:45 PM
Caching and headers - by El Forum - 11-17-2008, 10:53 PM
Caching and headers - by El Forum - 11-18-2008, 02:47 AM
Caching and headers - by El Forum - 11-18-2008, 03:18 AM
Caching and headers - by El Forum - 06-23-2009, 03:40 AM
Caching and headers - by El Forum - 01-22-2010, 08:22 AM
Caching and headers - by El Forum - 06-04-2012, 10:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB