By leapmonkey on
Hey Guys,
I recently started working on a theme for drupal6. The theme seems to be working correctly, styles are being applied, template files seem ok (nott too sure about theme_name.info file), but I keep getting this weird thing at the ending to all css files.
I keep seeing this
R?
at the end of my file path on all css files. The theme still works, and styles are being applied.
On my server all the files are just names style_name.css but when I look at the source code in firebug, or view the source on any browser I see the files as being:
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?R" />
<link type="text/css" rel="stylesheet" media="all" href="/themes/ctrlphone/style.css?R" />
M page.tpl.php file looks normal
<?php print $head; ?>
<?php print $styles; ?>
<?php print $scripts; ?>
Any ideas?
Comments
That is added by Drupal
The letter after the ? (and the ? itself) is added by Drupal to avoid the CSS files get cached by the web browser.
The letter added changes from time in time, and the browser will think that the referred file is different from the one it already has.
-- Kiam@AVPnet
That is the result of _drupal_flush_css_js()
The function that implements such functionality is
_drupal_flush_css_js()that contains the following code:The function is called by
drupal_flush_all_caches(), which in turn is called bysystem_clear_cache_submit().-- Kiam@AVPnet
Pay attention ...
If you pay a little closer attention you'll see that the filenames end in ?R, not R? ... the significance is that ? indicates that the characters following are to be parsed for arguments. By rotating through the alphanumeric characters, Drupal ensures that your browser is working with a current version of a (possibly altered) CSS file. This avoids maddening "why is my site not changing when I edit files" experiences.