Jump to content
CMSTOOLS.ru - форум поддержки и развития CMS

[Модификация] Ускоряем роботу сайта

Recommended Posts

1. В .htaccess добавить:

FileETag MTime Size
<ifmodule mod_expires.c>
<filesmatch ".(jpg|jpeg|gif|png|ico|css|js)$">
ExpiresActive on
ExpiresDefault "access plus 1 month"
<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
<ifModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType text/html "access plus 1 seconds"
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
<ifModule mod_headers.c>
  <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
  <filesMatch "\\.(css)$">
    Header set Cache-Control "max-age=604800, public"
  <filesMatch "\\.(js)$">
    Header set Cache-Control "max-age=216000, private"
  <filesMatch "\\.(xml|txt)$">
    Header set Cache-Control "max-age=216000, public, must-revalidate"
  <filesMatch "\\.(html|htm|php)$">
    Header set Cache-Control "max-age=1, private, must-revalidate"

2. Работем в файлах index.php и templates.php
2.1 Заружаем accelerator.php в /system/classes/
2.2 Открить index.php


define('ENGINE_DIR', ROOT_DIR.'/system');



2.3 Открить templates.php

function load_template($tpl_name) {


if( $this->CacheTemplate[ $tpl_name ] )
        $this->copy_template = $this->CacheTemplate[ $tpl_name ];
        return true;


$this->copy_template = $this->template;


$this->CacheTemplate[ $tpl_name ] = $this->template;

PS: Работает или нет - не понятно.



Link to comment
Share on other sites

  • 3 months later...
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...