how the drupal set css/js query string for cache buster
Css/js can be cached by browser, CDN or Varnish cache. If a new version css/js released, we want browser/CDN/Varnish request drupal to get new version.
Drupalwillappendarandomstringtocss/jssurltoworkascachebuster.
[Howtogeneratequerystring?]
ThisrandomstringisstoredinDBvariabletablebydefault,namedas‘css_js_query_string’.Whencommon.incdrupal_flush_all_caches()iscalled,itwillcall_drupal_flush_css_js()thengeneratearandomstringwith6characters.
Wecanalsohardcodethevalueinsettings.php.
[Howtousethequerystring?]
Incommon.incdrupal_pre_render_styles()function,itwillcallvariable_get(‘css_js_query_string’,0)togetthevalueandappendoneachcss.
相关推荐
yongzhang 2019-12-09
huangjingqian 2016-07-01
WordPress 2016-01-29
89447517 2016-01-27
vavid 2016-01-26
ozhanjun 2016-01-22
Zybzzz 2013-04-29
89447517 2011-07-28
lbcmail 2012-09-18
墨氺 2013-01-19
nothings0o 2011-10-27
RENYUAN 2011-04-17
quickily 2019-01-04
83133756 2016-10-18
zhaoweiping 2018-12-14
信息安全 2018-04-26
xrslt 2018-03-29
fzxhsaj 2018-03-29