js, css 캐싱 팁

· 12년 전 · 2803
아래와 같이 스크립트로 삽입을 하면 f5, ctrl+shift+r 등에 영향을 받지 않고 계속 캐싱되어 있게 됩니다.
load.js 파일로 하나 만들어둡니다.
아래의 스크립트들은 jQuery 1.9 대응하도록 수정을 좀 한것들인데 오류가 있을 수 있습니다.
// https://developers.google.com/speed/libraries/devguide
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js">\x3C/script>');
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js">\x3C/script>');
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/i18n/jquery-ui-i18n.min.js">\x3C/script>');
document.write('<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/smoothness/jquery-ui.css" />');
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js">\x3C/script>');
// https://css-browser-selector.googlecode.com/
document.write('<script type="text/javascript" src="//css-browser-selector.googlecode.com/git/css_browser_selector.min.js">\x3C/script>');
// https://jqueryplaceholder.googlecode.com/
document.write('<script type="text/javascript" src="//jqueryplaceholder.googlecode.com/git/jquery.placeholder-0.2.min.js">\x3C/script>');
// http://code.google.com/p/jcaret/downloads/list
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/jquery/jquery.caret.min.js">\x3C/script>');
// http://archive.plugins.jquery.com/project/timers
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/jquery/jquery.timers.min.js">\x3C/script>');
// https://github.com/brandonaaron/jquery-mousewheel/downloads
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/jquery/jquery.mousewheel.min.js">\x3C/script>');
// http://www.dillerdesign.com/experiment/DD_belatedPNG/
if(window.CSSBS_ie6) {
    document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/DD_belatedPNG_0.0.8a.min.js">\x3C/script>');
    DD_belatedPNG.fix('.iepng');
}
// http://leandrovieira.com/projects/jquery/lightbox/
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/lightbox/jquery.lightbox-0.5.min.js">\x3C/script>');
document.write('<link rel="stylesheet" type="text/css" href="//jquery-xeno-ui.googlecode.com/git/lightbox/jquery.lightbox-0.5.min.css" />');
// http://www.ama3.com/anytime/
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/anytime/anytime.min.js">\x3C/script>');
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/anytime/anytimetz.min.js">\x3C/script>');
document.write('<link rel="stylesheet" type="text/css" href="//jquery-xeno-ui.googlecode.com/git/anytime/anytime.min.css" />');

 

첨부파일

js, css 캐싱 팁.txt (2.9 KB) 13회 2013-11-23 11:03
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
12년 전 조회 1,966
12년 전 조회 1,713
12년 전 조회 2,618
12년 전 조회 1,644
12년 전 조회 1,637
12년 전 조회 2,093
12년 전 조회 1,503
12년 전 조회 1,618
12년 전 조회 2,071
12년 전 조회 2,018
12년 전 조회 2,046
12년 전 조회 2,227
12년 전 조회 1,651
12년 전 조회 1,802
12년 전 조회 1,862
12년 전 조회 1,429
12년 전 조회 1,874
12년 전 조회 1,582
12년 전 조회 1,719
12년 전 조회 1,373
12년 전 조회 2,120
12년 전 조회 2,415
12년 전 조회 1,453
12년 전 조회 1,377
12년 전 조회 2,345
12년 전 조회 1,447
12년 전 조회 2,034
12년 전 조회 1,823
12년 전 조회 2,250
12년 전 조회 2,301
12년 전 조회 7,025
12년 전 조회 2,345
12년 전 조회 1,567
12년 전 조회 1,425
12년 전 조회 1,473
12년 전 조회 1,543
12년 전 조회 1,774
12년 전 조회 2,428
12년 전 조회 1,922
12년 전 조회 2,187
12년 전 조회 1,434
12년 전 조회 1,538
12년 전 조회 3,501
12년 전 조회 2,600
12년 전 조회 2,347
12년 전 조회 4,139
12년 전 조회 1,533
12년 전 조회 3,366
12년 전 조회 2,945
12년 전 조회 2,804
12년 전 조회 2,851
12년 전 조회 1,825
12년 전 조회 2,359
12년 전 조회 2,373
12년 전 조회 1,799
12년 전 조회 4,268
12년 전 조회 1,496
12년 전 조회 1,993
12년 전 조회 2,399
12년 전 조회 2,870
12년 전 조회 1,755
12년 전 조회 2,441
12년 전 조회 1,825
12년 전 조회 3,359
12년 전 조회 1,844
12년 전 조회 1,669
12년 전 조회 1,939
12년 전 조회 3,507
12년 전 조회 3,034
12년 전 조회 5,335
12년 전 조회 2,624
12년 전 조회 3,084
12년 전 조회 2,460
12년 전 조회 2,411
12년 전 조회 1,934
12년 전 조회 1,975
12년 전 조회 2,835
12년 전 조회 2,015
12년 전 조회 1,749
12년 전 조회 2,318
12년 전 조회 2,635
12년 전 조회 1,906
12년 전 조회 2,022
12년 전 조회 2,233
12년 전 조회 3,017
12년 전 조회 1,910
12년 전 조회 2,189
12년 전 조회 4,133
12년 전 조회 1,898
12년 전 조회 1,814
12년 전 조회 1,777
12년 전 조회 2,481
12년 전 조회 2,302
12년 전 조회 4,987
12년 전 조회 2,123
12년 전 조회 2,007
12년 전 조회 1,892
12년 전 조회 1,751
12년 전 조회 2,297
12년 전 조회 2,004