"?c=" glued to every asset

edited February 2013 in Bug Reports
I'm using the 1.0 beta. Why is it that that asset helper functions return a proper asset element/link but with a "?c=" glued to the end of the string?

For a quick and dirty hack-fix I have commented out lines 472-476 in "modules/fuel/libraries/Asset.php" but is it supposed to (not) work like that?

Funny thing is that strings returned by img() and img_path() don't have that glued addon, only css(), css_path(), js() an js_path(). I'm not using any other assets, so I can't tell how the other helper functions are behaving.

Comments

  • edited 8:19AM
    That is a cache buster. It's tied to the fuel/application/config/asset.php "assets_last_updated" value. The "asset_append_cache_timestamp" determines which assets get that appended to it and by default it is only set to js and css.
  • edited 8:19AM
    Thanks, got sorted that out. So now out of curiosity, why all my js and css assets were getting that? Were they all outdated? And how does it help (and in what way) by returning improper URIs in the end?
  • edited 8:19AM
    Its intended to help if you make a CSS or JS change to a file, and you don't want people to use the cached version. Appending the ?c= with the timestamp info at the end will cause the browser to see it as a different version and not pull from the cache. To break the cache, you change the "assets_last_updated" value in the asset config. The reason why the js and css have it is because of the value for the "asset_append_cache_timestamp " in the asset config file. To remove it, you can set that value to an empty array.
  • edited 8:19AM
    That clears it up, thank you.
Sign In or Register to comment.