Çevrimdışı
Machine
|
Tarih: 03-03-2014, Saat:16:42
|
|
(Son Düzenleme: 03-03-2014, Saat:16:43, Düzenleyen: Machine.)
Merhabalar,
Sitenizin biraz daha hızlı açılmasını istiyorsanız .htacces'e ekleyeceğiniz ufak bir cache kodu ile sitenizin açılış hızını artırabilirsiniz.
PHP Kod:
#Önbellek <ifmodule mod_expires.c> <filesmatch "\.(jpg|gif|png|css|js|php|html|jpeg|ico|swf)$"> ExpiresActive on ExpiresDefault "access plus 1 year" </filesmatch> </ifmodule>
Yukarda ki kodu .htacces dosyasınıza eklerseniz sayfa açılış ve sayfa yükü azalacaktır. Bu kod sayesinde tarayıcılara birkez sitenizin resim dosyalarını kaydeder.1 yıl boyunca bu dosyalara silinmez (eğer kullanıcı silmezse).
Bu kod sayesinde sitenize giren herkes birkerelik js.jpg,php gibi dosyalarınızı bir kez bilgisayarlarına kaydedecektir ve tekrar girişlerinde sitenize bu dosyaları indirmek zorunda kalmayacak ve buda sayfanızın hızlı açılmasını sağlayacaktır.
Ek olarak,
Smyrna35 (halil) hocamızın, sitesinde yazdığı bir makalede sizin işinize yarayacaktır. Şahsen benim işime yaradı
Kod:
http://www.genelfrm.com/konu-javascript-ve-css-sikistirma-optimize-etme.html
İyi forumlar.
Çevrimdışı
bitanem03
|
Tarih: 03-03-2014, Saat:17:26
|
|
jquery.cookie.js bi dosya buldum resim dosyaları arasında
PHP Kod:
/** * Cookie plugin * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */
/** * Create a cookie with the given name and value and other optional parameters. * * @example $.cookie('the_cookie', 'the_value'); * @desc Set the value of a cookie. * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); * @desc Create a cookie with all available options. * @example $.cookie('the_cookie', 'the_value'); * @desc Create a session cookie. * @example $.cookie('the_cookie', null); * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain * used when the cookie was set. * * @param String name The name of the cookie. * @param String value The value of the cookie. * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. * If set to null or omitted, the cookie will be a session cookie and will not be retained * when the the browser exits. * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will * require a secure protocol (like HTTPS). * @type undefined * * @name $.cookie * @cat Plugins/Cookie * @author Klaus Hartl/[email protected] */
/** * Get the value of a cookie with the given name. * * @example $.cookie('the_cookie'); * @desc Get the value of a cookie. * * @param String name The name of the cookie. * @return The value of the cookie. * @type String * * @name $.cookie * @cat Plugins/Cookie * @author Klaus Hartl/[email protected] */ jQuery.cookie = function(name, value, options) { if (typeof value != 'undefined') { // name and value given, set cookie options = options || {}; if (value === null) { value = ''; options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE } // NOTE Needed to parenthesize options.path and options.domain // in the following expressions, otherwise they evaluate to undefined // in the packed version for some reason... var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { // only name given, get cookie var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } }; Hide details Change log r6125 by klaus.hartl on Jan 18, 2009 Diff Cookie plugin: Fixed unexpected change of given options when deleting a cookie Go to: Project members, sign in to write a code review Older revisions r3931 by klaus.hartl on Nov 25, 2007 Diff r3921 by klaus.hartl on Nov 24, 2007 Diff r1613 by klaus on Apr 1, 2007 Diff All revisions of this file File info Size: 4371 bytes, 97 lines View raw file
temada açık yapmaz dimi
Çevrimdışı
xpserkan
|
Tarih: 03-03-2014, Saat:18:24
|
|
Bu arada, 2 farklı sıkıştırma mantığı vardır, biri S.G hocanın dediği yol, diğeride .js dosyalarını birleştirme yoludur.
.js. ve .css dosyalarını hem birleştirme hemde sıkıştırma yaparak hız farkını 2 hatta 4 katına kadar çıkartmanız mümkün.
MyBB'nin genel olarak kullanılan 3 tane .js dosyası mevcut;
- general.js
- prototype.js
- popup_menu.js
Bunları mybb.js adında bir javascript dosyası oluşturup + sıkıştırıp tek dosya olarak kullanabilirsiniz.
Çevrimdışı
bitanem03
|
Tarih: 03-03-2014, Saat:19:09
|
|
(Son Düzenleme: 03-03-2014, Saat:19:22, Düzenleyen: bitanem03.)
(03-03-2014, Saat:18:24)xpserkan Adlı Kullanıcıdan Alıntı: Bu arada, 2 farklı sıkıştırma mantığı vardır, biri S.G hocanın dediği yol, diğeride .js dosyalarını birleştirme yoludur.
.js. ve .css dosyalarını hem birleştirme hemde sıkıştırma yaparak hız farkını 2 hatta 4 katına kadar çıkartmanız mümkün.
MyBB'nin genel olarak kullanılan 3 tane .js dosyası mevcut;
- general.js
- prototype.js
- popup_menu.js
Bunları mybb.js adında bir javascript dosyası oluşturup + sıkıştırıp tek dosya olarak kullanabilirsiniz.
serkan hocam sg hocamın verdiği linkten yapıyorum sağolun
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1600"></script>
bunları diyorsunuz herhalde hocam0
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/mybb.js "></script> olarak yapacağız dimi
İzinli
Smyrna35
|
Tarih: 03-03-2014, Saat:19:18
|
|
(Son Düzenleme: 03-03-2014, Saat:19:19, Düzenleyen: Smyrna35.)
Gerekli yorumlar gelmiş ben kendi görüşüm olarak yorum yapmak istedim.
Bence dışarıdan gelen javascript yada her hangi başka bir dosya her zaman bir dezavantaj.Çünkü sitenizdeki sayfa yüklendikten sonra birde ek olarak diğer dosyanın barındığı sayfa yüklenme gereği duyuyor ve biraz da olsa hız açısından bir yavaşlama söz konusu biz bu hızı fark edemesekte arama motorları bu hızı fark edebilir.Arama motorları her zaman hızlı siteleri sever.
Birde şöyle bir şey var dışarıdan çağrılan dosyalar sıkıştırılmamış olabiliyor gerek js dosyası gerek diğer dosyalar genellikle sıkıştırılmamış olarak çağrılıyor.Hem sıkıştırılmadığı için yavaşlık söz konusu hemde başka siteden çekildiği için ayrı bir yavaşlık söz konusu oluyor.
Bu nedenle dosyaları kendi sitenize alarak ve sıkıştırma yaparak hem dosya boyutunu düşürürsünüz hemde sayfa açılış hızını düşürmüş olursunuz.
Sıkıştırmaya değinmişken aşağıdaki dosyaları nasıl sıkıştırabileceğinizi araştırabilirsiniz.
HTML (Mybb'de şablonlardan) , CSS (Mybb'de temalardan) , Javascript (Mybb'de ftp>jscript klasöründe barınır ek bir js yüklediyseniz onuda sıkıştırınız) , resim dosyalarını (jpg,png,gif vb. dosyalar) sıkıştırabilirsiniz.
Bu sıkıştırmalar hız açısından faydalı olacaktır.
Sayfa hızı ile ilgili diğer bazı bilgileri pagespeed,gtmetrix ve yslow araçlarını kullanarak öğrenip çözebilirsiniz.
Çevrimdışı
xpserkan
|
Tarih: 03-03-2014, Saat:22:01
|
|
(03-03-2014, Saat:19:09)bitanem03 Adlı Kullanıcıdan Alıntı: serkan hocam sg hocamın verdiği linkten yapıyorum sağolun
Kod:
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1603"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1600"></script>
bunları diyorsunuz herhalde hocam0
olarak yapacağız dimi
Aynen hocam, üstekileri headerinclude şablonundan silip, yeni oluşturduğunuz mybb.js dosyasının html kodunu şu şekilde sildiklerinizin yerine ekliyorsunuz.
Kod:
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/mybb.js?ver=1603"></script>
Bu arada şunu belirtmekte fayda var; Bazı mybb güncellemelerinde .js dosyalarıda güncellenebiliyor. Bu sebepten dolayı güncelleme yaparken .js dosyası güncelleme paketinde var mı yok mu kontrol edin. Varsa güncel dosyayı tekrar sıkıştırıp mybb.js dosyasını güncelleyin.
Ayrıca mybb.js dosyasına yapıştıracağınız dosya kodları sıralaması şu şekilde olacak.
- prototype.js En üste bu dosyasının kodları yer alsın.
- general.js Ortada bu dosyanın kodları yer alsın.
- popup_menu.js En sonda bu dosyanın kodları yer alsın.
Son olarak jquery ile mybb.js dosyalarını sakın birleştirmeyin Çakışma yapacağı için çalışmayacaktır.
Çevrimdışı
bitanem03
|
Tarih: 04-03-2014, Saat:01:08
|
|
Sağol hocam sıkıştırdım şuan sıkıntı yok tavsiye ederim fayda %100 hızı artıyor tamam wmaracı seo da 86 seohocası seo aracında ise 76 puan alıyor ayrıca. Optimize 78 doğru
|