2009-05-05 95 views
2

我的設計師注意到,在一個drupal站點的源代碼中,所有.css文件都被附加了一個他所關心的將會破壞的東西。它爲什麼這樣做?爲什麼drupal會追加?1到我的css文件鏈接

<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/node/node.css?l" /> 
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/system/defaults.css?l" /> 
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/system/system.css?l" /> 
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/system/system-menus.css?l" /> 
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/user/user.css?l" /> 

回答

10

我在爲Drupal的源代碼戳了一圈,發現這樣的:

// A dummy query-string is added to filenames, to gain control over 
// browser-caching. The string changes on every update or full cache 
// flush, forcing browsers to load a new copy of the files, as the 
// URL changed. 
$query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1); 

我想,回答說。我會假設,因爲drupal的人正在這樣做,即瀏覽器在css鏈接標籤中查詢字符串很酷,即使我的設計師偏執於它。

希望這有助於有人一個谷歌在一天= P

+0

@easel:你應該紀念這個作爲公認的答案(不要緊,它是你的自己) – 2009-12-10 16:57:56

+0

感謝提示= p完成 – easel 2009-12-10 22:03:11

相關問題