GZip چیست؟

جی زیپ GZip چیست؟چه کاربردی دارد؟

جی زیپ سیستم فشرده سازی است که در آن فایل فشرده به مرورگر ارسال میشود و مرورگر بعد از دریافت آن را از حالت فشرده خارج و به کاربر نشان میدهد و به طبع آن سرعت بارگذاری افزایش می یابد. با اضافه کردن این کد به فایل htaccess. میتوانید از این قابلیت برای فشرده سازی استفاده کنید:

# 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

آموزش
برنامه نویسی
اسکریپت
افزونه
قالب
معرفی سایت
اصطلاح
اطلاعیه ها

GZip چیست؟
Amir_P ۱۲:۳۰ ق.ظ ۰

GZip چیست؟

جی زیپ GZip چیست؟چه کاربردی دارد؟

جی زیپ سیستم فشرده سازی است که در آن فایل فشرده به مرورگر ارسال میشود و مرورگر بعد از دریافت آن را از حالت فشرده خارج و به کاربر نشان میدهد و به طبع آن سرعت بارگذاری افزایش می یابد. با اضافه کردن این کد به فایل htaccess. میتوانید از این قابلیت برای فشرده سازی استفاده کنید:
# 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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

# 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

از این سایت هم میتونید تغییر رو مشاهده کنید: http://gtmetrix.com

نویسنده مطلب
علی پامناری

دیدگاه کاربران

این وب سایت متعلق است به آذین وب (طراحی سایت در اصفهان) و تمامی حقوق آن محفوظ است.

طـبق ماده 12 فصل سوم قانون جرائم رایانه ای هرگونه کپی برداری از قالب پیگرد قانونی دارد.