Feature request: add user agent info to cached stylesheet
Posted: Thu Oct 06, 2011 10:41 am
If you use smarty in your stylesheets the stylesheet is processed only one time and cached. next request will return the processed cached styelsheet. so far so good. but if you use plugins where the result depends on the user agent (e.g. to use only styles for specific browsers) you will get always the same cached stylesheet.
One more detailed example: I use base64 encoded images in my stylesheets. I use a small plugin that only returns base64 data if the browser supports it or - if IE8 - the base64 data is smaller than 32 kb.
When i first visit that page with firefox the stylesheet is cached with base64 data. But when i visit the page the second time with IE8 or IE7 i will get the same stylesheet. IE7 will not display any images and IE 8 only if the base64 data is smaller than 32kb. If not, it will cut the image after 32kb.
So it would be nice if the stylesheet can be cached for each useragent separately. (as i can see you just need to add the $_SERVER['HTTP_USER_AGENT'] to the cached css filename)
One more detailed example: I use base64 encoded images in my stylesheets. I use a small plugin that only returns base64 data if the browser supports it or - if IE8 - the base64 data is smaller than 32 kb.
When i first visit that page with firefox the stylesheet is cached with base64 data. But when i visit the page the second time with IE8 or IE7 i will get the same stylesheet. IE7 will not display any images and IE 8 only if the base64 data is smaller than 32kb. If not, it will cut the image after 32kb.
So it would be nice if the stylesheet can be cached for each useragent separately. (as i can see you just need to add the $_SERVER['HTTP_USER_AGENT'] to the cached css filename)