iran 375 ارسال شده در آبان 92 گزارش بازنشر ارسال شده در آبان 92 سلام من هرچه می خوام با کد زیر فایل هامو کش کنم نمی شهممکنه از طرف سرور غیر فعال شده باشه ؟# START Expires<IfModule mod_expires.c>ExpiresActive OnExpiresDefault "access plus 2 month"ExpiresByType image/gif "access plus 2 month"ExpiresByType image/gif "access plus 2 month"ExpiresByType image/png "access plus 2 month"ExpiresByType image/jpg "access plus 2 month"ExpiresByType image/jpeg "access plus 2 month"ExpiresByType image/ico "access plus 2 month"ExpiresByType text/css "access plus 2 month"ExpiresByType text/javascript "access plus 2 month"</IfModule># END Expires نقل قول لینک به ارسال
SMJ SOFT 510 ارسال شده در آبان 92 گزارش بازنشر ارسال شده در آبان 92 این رو تو .htaccess استفاده کنید :<ifModule mod_deflate.c> <filesMatch ".(css|js|x?html?|php)$"> SetOutputFilter DEFLATE </filesMatch></ifModule>این کد، فایلهای CSS، JS، HTML، XHTML و PHP سایت شما را gzip میکند.کد زیر نیز یک نمونه بسیار خوب برای فشرده سازی فایلهای مورد اشاره روی سایت شما و نیز Cache کردن دیگر فایلهای استاتیک است.# BEGIN Compress text files<ifModule mod_deflate.c> <filesMatch ".(css|js|x?html?|php)$"> SetOutputFilter DEFLATE </filesMatch></ifModule># END Compress text files# BEGIN Expire headers<ifModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType image/x-icon "access plus 2592000 seconds" ExpiresByType image/jpeg "access plus 2592000 seconds" ExpiresByType image/png "access plus 2592000 seconds" ExpiresByType image/gif "access plus 2592000 seconds" ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds" ExpiresByType text/css "access plus 604800 seconds" ExpiresByType text/javascript "access plus 216000 seconds" ExpiresByType application/javascript "access plus 216000 seconds" ExpiresByType application/x-javascript "access plus 216000 seconds" ExpiresByType text/html "access plus 600 seconds" ExpiresByType application/xhtml+xml "access plus 600 seconds"</ifModule># END Expire headers# BEGIN Cache-Control Headers<ifModule mod_headers.c> <filesMatch ".(ico|jpe?g|png|gif|swf)$"> Header set Cache-Control "max-age=2592000, public" </filesMatch> <filesMatch ".(css)$"> Header set Cache-Control "max-age=604800, public" </filesMatch> <filesMatch ".(js)$"> Header set Cache-Control "max-age=216000, private" </filesMatch> <filesMatch ".(x?html?|php)$"> Header set Cache-Control "max-age=600, private, must-revalidate" </filesMatch></ifModule># END Cache-Control Headers# BEGIN Turn ETags Off<ifModule mod_headers.c> Header unset ETag</ifModule>FileETag None# END Turn ETags Off# BEGIN Remove Last-Modified Header<ifModule mod_headers.c> Header unset Last-Modified</ifModule># END Remove Last-Modified Header نقل قول لینک به ارسال
iran 375 ارسال شده در آبان 92 مالک گزارش بازنشر ارسال شده در آبان 92 نه عزیز جواب نگرفتم نقل قول لینک به ارسال
Farid 2281 ارسال شده در آبان 92 گزارش بازنشر ارسال شده در آبان 92 سلاماین رو امتحان کنید## EXPIRES CACHING ##ExpiresActive OnExpiresByType image/jpg "access plus 1 year"ExpiresByType image/jpeg "access plus 1 year"ExpiresByType image/gif "access plus 1 year"ExpiresByType image/png "access plus 1 year"ExpiresByType text/css "access plus 1 month"ExpiresByType application/pdf "access plus 1 month"ExpiresByType text/x-javascript "access plus 1 month"ExpiresByType application/x-shockwave-flash "access plus 1 month"ExpiresByType image/x-icon "access plus 1 year"ExpiresDefault "access plus 2 days" 1 نقل قول لینک به ارسال
iran 375 ارسال شده در آبان 92 مالک گزارش بازنشر ارسال شده در آبان 92 سلاماین رو امتحان کنید## EXPIRES CACHING ##ExpiresActive OnExpiresByType image/jpg "access plus 1 year"ExpiresByType image/jpeg "access plus 1 year"ExpiresByType image/gif "access plus 1 year"ExpiresByType image/png "access plus 1 year"ExpiresByType text/css "access plus 1 month"ExpiresByType application/pdf "access plus 1 month"ExpiresByType text/x-javascript "access plus 1 month"ExpiresByType application/x-shockwave-flash "access plus 1 month"ExpiresByType image/x-icon "access plus 1 year"ExpiresDefault "access plus 2 days"دوست عزیزم کد منم همینه اما متاسفانه جواب نمی ده نقل قول لینک به ارسال
Farid 2281 ارسال شده در آبان 92 گزارش بازنشر ارسال شده در آبان 92 فایل htaacess. رو پیوست کنید نقل قول لینک به ارسال
iran 375 ارسال شده در آبان 92 مالک گزارش بازنشر ارسال شده در آبان 92 فایل htaacess. رو پیوست کنید# BEGIN WordPress<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /RewriteRule ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</IfModule># END WordPress<Files 403.shtml>order allow,denyallow from all</Files>## EXPIRES CACHING ##ExpiresActive OnExpiresByType image/jpg "access plus 1 year"ExpiresByType image/jpeg "access plus 1 year"ExpiresByType image/gif "access plus 1 year"ExpiresByType image/png "access plus 1 year"ExpiresByType text/css "access plus 1 month"ExpiresByType application/pdf "access plus 1 month"ExpiresByType text/x-javascript "access plus 1 month"ExpiresByType application/x-shockwave-flash "access plus 1 month"ExpiresByType image/x-icon "access plus 1 year"ExpiresDefault "access plus 2 days" نقل قول لینک به ارسال
Farid 2281 ارسال شده در آبان 92 گزارش بازنشر ارسال شده در آبان 92 سلام . کدتون رو خودم روی سرور تست کردم و جواب میده . شما باز این کد رو امتحان کنید و بعدش با gtmetrix تست کنید ببینید درصد Leverage browser caching زیاد شده یا نه . با این کد باید درصدش بیاد روی حدود 80 تا 90 . اگه باز نشده باشه مشکل از سرور شماست ## EXPIRES CACHING ##ExpiresActive OnExpiresByType image/jpg "access plus 1 year"ExpiresByType image/jpeg "access plus 1 year"ExpiresByType image/gif "access plus 1 year"ExpiresByType image/png "access plus 1 year"ExpiresByType text/css "access plus 1 month"ExpiresByType application/pdf "access plus 1 month"ExpiresByType text/x-javascript "access plus 1 month"ExpiresByType application/x-shockwave-flash "access plus 1 month"ExpiresByType image/x-icon "access plus 1 year"ExpiresDefault "access plus 2 days"<IfModule mod_expires.c># Enable expirationsExpiresActive On# Default directiveExpiresDefault "access plus 1 month"# My faviconExpiresByType image/x-icon "access plus 1 year"# ImagesExpiresByType image/gif "access plus 1 month"ExpiresByType image/png "access plus 1 month"ExpiresByType image/jpg "access plus 1 month"ExpiresByType image/jpeg "access plus 1 month"# CSSExpiresByType text/css "access 1 month"# JavascriptExpiresByType application/javascript "access plus 1 year"</IfModule> 1 نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در آبان 92 گزارش بازنشر ارسال شده در آبان 92 عذر می خوام کش کردن فایلهای ایستاتیکی یعنی چی؟فایل وقتی ایستاتیکه که نیازی به کش نداره یعنی در واقع کش اون فایل می شه یک کپی از خود فایل کش وظیفه اش کپی برداری از بخش های داینامیکه که در هر بار لود مجبور نباشه اونها رو از دیتابیس چک کنه 3 نقل قول لینک به ارسال
iran 375 ارسال شده در آبان 92 مالک گزارش بازنشر ارسال شده در آبان 92 (ویرایش شده) عذر می خوام کش کردن فایلهای ایستاتیکی یعنی چی؟فایل وقتی ایستاتیکه که نیازی به کش نداره یعنی در واقع کش اون فایل می شه یک کپی از خود فایلکش وظیفه اش کپی برداری از بخش های داینامیکه که در هر بار لود مجبور نباشه اونها رو از دیتابیس چک کنهاز مباحث بالا بایستی تا الان متوجه شده بودین اما بازم توضیح می دممنظورم همون فایل هایی مثل عکس و جاوا و سی اس اس و .... که همیشه در کلیه صفحات سایت حضور دارند و تغییر نمی کنندمنظور از کش کردن فایل هم اینه در مرورگر کاربر کش بشه به مدت طولانیهمون چیزی که گوگل اسپید چک و gtmetrix.com همش به سایت من این گزینه رو گیر می دن Leverage browser cachingامیدوارم توضیحاتم برای شما تکمیل بوده باشه و چیزی متوجه شده باشید ویرایش شده آبان 92 توسط iran 1 نقل قول لینک به ارسال
iran 375 ارسال شده در آبان 92 مالک گزارش بازنشر ارسال شده در آبان 92 سلام . کدتون رو خودم روی سرور تست کردم و جواب میده . شما باز این کد رو امتحان کنید و بعدش با gtmetrix تست کنید ببینید درصد Leverage browser caching زیاد شده یا نه . با این کد باید درصدش بیاد روی حدود 80 تا 90 . اگه باز نشده باشه مشکل از سرور شماست نه دوست عزیز نشد که نشداحتمالا از سرور هست نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در آبان 92 گزارش بازنشر ارسال شده در آبان 92 معمولا اول عنوان رو می خونم وقتی عنوان مشکل داره ادامه را نمی خونم یعنی فرصتش نیستبرای کش شدن فایل های js و تصاویر معمولا قابلیت از طرف سرور تعریف می شه و نیازی به تعریف مجدد کاربر نداره و برای فایل های css باید کوکی ساخته بشه با جاوا اسکریپت کدی شبیه :function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else expires = ""; document.cookie = name+"="+value+expires+"; path=/";}function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null;}window.onload = function(e) { var cookie = readCookie("style"); var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title);}window.onunload = function(e) { var title = getActiveStyleSheet(); createCookie("style", title, 365);}var cookie = readCookie("style");var title = cookie ? cookie : getPreferredStyleSheet();setActiveStyleSheet(title);که البته یک سرور خوب معمولا این کار را هم خودش مستقیم می کنه و بعید می دونم الان سایتی باشه که دستور کوکی یا کش کاربر رو دستی بنویسه 2 نقل قول لینک به ارسال
iran 375 ارسال شده در آبان 92 مالک گزارش بازنشر ارسال شده در آبان 92 تیکت فرستادم مدیر سرور این قضیه رو حل کنند 1 نقل قول لینک به ارسال
hheidari02 0 ارسال شده در شهریور 94 گزارش بازنشر ارسال شده در شهریور 94 با سلاممتاسفانه سایتم دچار ایراد شده در این بخشLeverage browser cachinghttp://babu.ir/css/font-awesome.min.css (expiration not specified)http://babu.ir/css/fonts/BYekan.woff (expiration not specified)http://babu.ir/css/style.css (expiration not specified)http://babu.ir/img/PEP-logo.gif (expiration not specified)http://babu.ir/img/ic-keys.png (expiration not specified)http://babu.ir/img/ic-tag.png (expiration not specified)http://babu.ir/img/mellat.jpg (expiration not specified)http://babu.ir/img/samandehi-logo.jpg (expiration not specified)http://babu.ir/js/jquery-1.9.1.min.js (expiration not specified)http://babu.ir/js/jquery.min.js (expiration not specified)http://babu.ir/js/jssor.js (expiration not specified)http://babu.ir/js/jssor.slider.js (expiration not specified)http://babu.ir/loading.gif (expiration not specified)http://babu.ir/logo/amazon.jpg (expiration not specified)http://babu.ir/logo/android.jpg (expiration not specified)http://babu.ir/logo/bitly.jpg (expiration not specified)http://babu.ir/logo/blogger.jpg (expiration not specified)http://babu.ir/logo/dnn.jpg (expiration not specified)http://babu.ir/logo/drupal.jpg (expiration not specified)http://babu.ir/logo/ebay.jpg (expiration not specified)http://babu.ir/logo/facebook.jpg (expiration not specified)http://babu.ir/logo/google.jpg (expiration not specified)http://babu.ir/logo/ibm.jpg (expiration not specified)http://babu.ir/logo/ios.jpg (expiration not specified)http://babu.ir/logo/joomla.jpg (expiration not specified)http://babu.ir/logo/linkedin.jpg (expiration not specified)http://babu.ir/logo/mac.jpg (expiration not specified)http://babu.ir/logo/magento.jpg (expiration not specified)http://babu.ir/logo/pinterest.jpg (expiration not specified)http://babu.ir/logo/samsung.jpg (expiration not specified)http://babu.ir/logo/twitter.jpg (expiration not specified)http://babu.ir/logo/windows.jpg (expiration not specified)http://babu.ir/logo/wordpress.jpg (expiration not specified)http://babu.ir/logo/youtube.jpg (expiration not specified)http://babu.ir/upload/1440215480.jpg (expiration not specified)http://babu.ir/upload/1440224427.jpg (expiration not specified)http://babu.ir/upload/1440312778.jpg (expiration not specified)http://babu.ir/upload/1440325614.jpg (expiration not specified)http://babu.ir/upload/1440844233.jpg (expiration not specified)http://babu.ir/upload/noimg.jpg (expiration not specified)http://enamad.ir/images/namad1.png (expiration not specified)http://www.babu.ir/img/ads.png (expiration not specified)http://www.babu.ir/img/cars.png (expiration not specified)میشه راهنمایی بفرمایید چه کدی باید وارد کنم؟ نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .