[eluser]Pinkiee[/eluser]
I decided for various reason to handle my assets through a controller, by using a <base> and adding three simple rewrite rules in to the routes.php
Code:
$route["([a-z]+).css"] = "assets/css/$1";
$route["images/(:any)"] = "assets/images/$1";
$route["scripts/(:any)"] = "assets/scripts/$1";
And then with in an "assets" controller it was just a matter of creating a method for each of the asset types. For example :
Code:
public function css($file)
{
$this->output->set_header('Content-type: text/css');
$this->load->view('skins/' . $this->skin . '/css/' . $file . '.css');
}
The scripts method is pretty much the same (differnt header) and the images method just uses the get_mime_by_extension($image); to work out the header.
The problem I am having is while the page will display correctly 25% of the time, the large majority of refreshs will reload the page with one or two images not loaded. Furthermore about 20% of the time the page will not load a CSS file.
Things I have checked:
* httpd
* removing a large amount of the css file
* compressing the css
* setting the expires upon the headers
* testing in differnt browers
* viewing the images/css separatly works correctly
* optimising the routing, removing any other routes not realated to the problem
* removing my base controller and using the default "Controller" Library
I was wondering if anyone else has either come across this problem or can think of why it would happen and how to fix it.
Thanks