Issue Bug Closed

#20423includeCSS and includeJS need extra parameter: urlParam

Michiel Roos 05/14/09, 17:55 updated 05/15/09, 22:04

Description

includeCSS and includeJS need extra parameter: urlParam

I would like for the following to work so I can send ‘far future expires headers’ [1]:

page.includeCSS = COA
page.includeCSS {
file1 = {$stylePath}main.css?v1
file1.media = screen
}

But this does not work!

So I would like this to work

page.includeCSS = COA
page.includeCSS {
file1 = {$stylePath}main.css
file1.media = screen
file1.urlParam = v1
}

When I change the css or js file I can increment the version to v2 etc.

page.includeCSS = COA
page.includeCSS {
file1 = {$stylePath}main.css
file1.media = screen
file1.urlParam = v2
}

[1] http://developer.yahoo.com/performance/rules.html

Using get-parameters for css is not very clean, and actually browsers should not take anything following a ? into account when caching, even though most browsers do [2]. Using the suggested method will result in certain browsers not caching the file at all.

The right solution would be to versionize css files with the name, as suggested in [1].

[2]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.9
(issue imported from #M11088)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.