js, css 캐싱 팁

· 12년 전 · 1796
아래와 같이 스크립트로 삽입을 하면 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,134
12년 전 조회 856
12년 전 조회 1,766
12년 전 조회 766
12년 전 조회 775
12년 전 조회 1,266
12년 전 조회 659
12년 전 조회 754
12년 전 조회 1,205
12년 전 조회 1,148
12년 전 조회 1,174
12년 전 조회 1,323
12년 전 조회 748
12년 전 조회 935
12년 전 조회 988
12년 전 조회 587
12년 전 조회 1,002
12년 전 조회 695
12년 전 조회 767
12년 전 조회 433
12년 전 조회 1,163
12년 전 조회 1,457
12년 전 조회 473
12년 전 조회 424
12년 전 조회 1,384
12년 전 조회 474
12년 전 조회 1,062
12년 전 조회 871
12년 전 조회 1,290
12년 전 조회 1,358
12년 전 조회 6,059
12년 전 조회 1,382
12년 전 조회 608
12년 전 조회 459
12년 전 조회 482
12년 전 조회 592
12년 전 조회 832
12년 전 조회 1,454
12년 전 조회 957
12년 전 조회 1,194
12년 전 조회 454
12년 전 조회 551
12년 전 조회 2,549
12년 전 조회 1,637
12년 전 조회 1,350
12년 전 조회 3,189
12년 전 조회 601
12년 전 조회 2,379
12년 전 조회 1,942
12년 전 조회 1,797
12년 전 조회 1,879
12년 전 조회 817
12년 전 조회 1,363
12년 전 조회 1,362
12년 전 조회 848
12년 전 조회 3,202
12년 전 조회 506
12년 전 조회 1,009
12년 전 조회 1,405
12년 전 조회 1,832
12년 전 조회 675
12년 전 조회 1,381
12년 전 조회 745
12년 전 조회 2,349
12년 전 조회 790
12년 전 조회 487
12년 전 조회 706
12년 전 조회 2,265
12년 전 조회 1,784
12년 전 조회 4,097
12년 전 조회 1,383
12년 전 조회 1,819
12년 전 조회 1,203
12년 전 조회 1,191
12년 전 조회 683
12년 전 조회 733
12년 전 조회 1,648
12년 전 조회 755
12년 전 조회 511
12년 전 조회 1,080
12년 전 조회 1,418
12년 전 조회 668
12년 전 조회 772
12년 전 조회 1,009
12년 전 조회 1,787
12년 전 조회 685
12년 전 조회 930
12년 전 조회 2,890
12년 전 조회 663
12년 전 조회 577
12년 전 조회 469
12년 전 조회 1,244
12년 전 조회 1,056
12년 전 조회 3,712
12년 전 조회 867
12년 전 조회 734
12년 전 조회 607
12년 전 조회 490
12년 전 조회 1,016
12년 전 조회 737
🐛 버그신고