By ToshoFreny on
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/modules/cck/theme/content.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/modules/cck/modules/fieldgroup/fieldgroup.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/modules/date/date.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/modules/filefield/filefield.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/modules/filefield_image/filefield_image.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/themes/zen/zen/html-elements.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/themes/zen/zen/tabs.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/themes/cs/layout.css?C" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/cs6.com/themes/zen/zen/block-editing.css?C" />
As you might notice in the above code, each stylesheet url contains a '?' and 'C', sometimes I see only the '?' alone. What does this mean? I'm sure this is not a bug given the amount of flexibility and detail the theme developer has given but what purpose does this serve?
Comments
A rose, by any other name, would smell as sweet.
This is a feature of Drupal, not just Zen. It gives you control over the browser’s cache: If one of the files changes, the filename stays the same, so the browser uses it’s own copy and doesn’t see the update. But Drupal changes the ?C to something else, the browser thinks it is a different file (it is different), and uses that – refreshing it’s cache.
The clever bit is that this enables Drupal to change the filename, but still refer to the same file.
___________________
It’s in the detaιls…
demonstration portfolio
Very Cool
Thanks for the description. That's a pretty cool trick.
Thanks,
LX-88
Thank you Zeta. That's very
Thank you Zeta. That's very clever. Can you please point me to the function or hook that does this? Just curious to know how this is done.
Loving Life,
Tosho Freny,
searching...
grep -n \'\?\' includes/*___________________
It’s in the detaιls…
demonstration portfolio
Zeta, you are too quick and
Zeta, you are too quick and concise! Thanks.
I am posting this incase someone else also wants to know this. The following function
drupal_get_cssadds the dummy query string to the css files. The same waydrupal_get_jsadds the dummy query string to js files. Both these function reside inincludes/common.phpLoving Life,
Tosho Freny,