[eluser]MindFeed[/eluser]
Thanks for your thoughts into the problem. Though if I keep the file name same, the problem stands as it is. As each and every request has been distributed among 5 apache servers through load balancer, if LB hit the first server for getting the PHP->HTML page, it might hit any of 5 server for loading various resources like images, css, javascript. So in this case only first server has the combined/minified javascript/css files and not other servers and hence response will be 404 with the rest of 4 servers, unless and until LB hit that server for PHP->HTML page.
Just preliminary thoughts towards solution:
=> Lets store the combined/minified version to DB, centrally accessible to all the servers.
=> Table will have four fields, asset_key, asset_type, asset_content, asset_dt
=> Store filename in asset_key (without extension, jst lastmodified + md5(filenames)), 'js' or 'css' in asset_type, combined and minified version to asset_content, and timestamp to asset_dt
=> In library we will check filename against asset_key in database instead of checking file on hard drive.
=> Modify _cache function to write into database instead of writing on disk
=> Modify _tag function where instead of including the combined/minified version of javascript/css from cache directory, will include path to controller/function which in turn read the database and echo the content with proper heading.
=> In that controller/function, I also can set proper caching header, after checking ETag and IF-Modified-Since
howz that!
Thanks,
Bhargav Khatana