0 Пользователей и 1 Гость просматривают эту тему.
  • 14 Ответов
  • 4680 Просмотров
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
Добрый день коллеги,

Есть простой на первый взгляд вопрос: Как принудительно отключить кеширование CSS и JS?

Кеширование у меня отключено в глобальных настройках, а также отключен системный плагин кеширования.
НО, Joomla 2.5 все равно создает кеш CSS и JS в папаке Cache в корне сайта.

У меня уже есть оптимизация в фале htaccess, мне не нужно это кеширование, так как оно только замедляет загрузку сайта, создавая кеши CSS файлов. Проверял на Google PageSpeed Insights - без этих кешированных CSS и js результаты намного выше.

Собственно вопрос - как принудительно запретить это кеширование? Я не могу понять, почему вообще Joomla 2.5 кеширует, если у меня везде отключено кешировние? Это какой-то внутренний прикол Joomla?
*

SmokerMan

  • Гуру
  • 5293
  • 720 / 26
Я не могу понять, почему вообще Joomla 2.5 кеширует, если у меня везде отключено кешировние?
Joomla  сама ничего не кэширует, возможно это сторонний плагин или какие-то настройки шаблона, если он клубный
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
Как это вообще можно определить, кто кеш создает?

Сторонних плагинов точно нет - когда то были и были успешно удалены.
Про шаблон не думал, пороюсь в нем.
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
Нет - это не шаблон создает кеш.
Было такое в настройках шаблона: Minify and combine CSS and JavaScript into a single file. Use gzip compression and Data URIs to reduce image file requests.

Убрал, проверил - все равно кеш создается.
*

Viktop

  • Захожу иногда
  • 97
  • 5 / 0
в htacces может быть
*

yuri-it

  • Давно я тут
  • 994
  • 44 / 3
  • Быстрый хостинг https://jehost.ru
НО, Joomla 2.5 все равно создает кеш CSS и JS в папаке Cache в корне сайта.

Сайты не кэшируют CSS и JS, их кэширует браузер, если веб-сервер проставляет им соответствующие заголовки. Но как я понял создаются файлы CSS и js в папке /cache, тогда единственное что приходит на ум, что есть софт на сервере или плагин, который обрабатывает CSS и JS (сжимает, объединяет) и поэтому уже кэширует результат, что разумно. htaccess тут не причем.
По-настоящему быстрый хостинг для Joomla : https://jehost.ru
Отзывы: http://joomlaforum.ru/index.php/topic,109288.0.html
Отзывы по хостингу http://hosting101.ru/jehost.ru
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
Вот файл htaccess:

##
# @package      Joomla
# @copyright   Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved.
# @license      GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your SEF url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
##


## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

## Mod_rewrite in use.


RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#Redirect to dymanic pages
#RewriteCond %{HTTP_HOST} ^www.tel-number\.ru$ [NC]
#RewriteRule ^(.*)$ https://tel-number.ru/$1 [R=301,L]

RewriteCond %{HTTPS} !^on$
RewriteRule (.*) https://tel-number.ru/$1 [R=301,L]

#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#

#Options +FollowSymLinks
#RewriteEngine On
#RewriteCond %{HTTP_HOST} ^www.tel-number\.ru$ [NC]
#RewriteRule ^(.*)$ http://tel-number.ru/$1 [R=301,NC]

RewriteRule ^our-news /our-services/$1 [R=301,L]

Redirect 301 /our-services/7352-ecommerce-market-in-germany /blog/7352-ecommerce-market-in-germany
Redirect 301 /our-services/7349-toll-free-number-for-landing-pages /blog/7349-toll-free-number-for-landing-pages

## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.


php_flag display_errors 1

########## Begin - ETag Optimization
## This rule will create an ETag for files based only on the modification
## timestamp and their size.
## Note: It may cause problems on your server and you may need to remove it
FileETag MTime Size
# AddOutputFilterByType is now deprecated by Apache. Use mod_filter in the future.
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css text/javascript application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
# Enable expiration control
ExpiresActive On
# Default expiration: 1 hour after request
ExpiresDefault "now plus 1 day"
# CSS and JS expiration: 1 week after request
ExpiresByType text/css "now plus 1 week"
ExpiresByType text/javascript "now plus 1 week"
ExpiresByType application/javascript "now plus 1 week"
ExpiresByType application/x-javascript "now plus 1 week"
# Image files expiration: 1 month after request
ExpiresByType image/bmp "now plus 1 month"
ExpiresByType image/gif "now plus 1 month"
ExpiresByType image/jpeg "now plus 1 month"
ExpiresByType image/jp2 "now plus 1 month"
ExpiresByType image/pipeg "now plus 1 month"
ExpiresByType image/png "now plus 1 month"
ExpiresByType image/svg+xml "now plus 1 month"
ExpiresByType image/tiff "now plus 1 month"
ExpiresByType image/vnd.microsoft.icon "now plus 1 month"
ExpiresByType image/x-icon "now plus 1 month"
ExpiresByType image/ico "now plus 1 month"
ExpiresByType image/icon "now plus 1 month"
ExpiresByType text/ico "now plus 1 month"
ExpiresByType application/ico "now plus 1 month"
ExpiresByType image/vnd.wap.wbmp "now plus 1 month"
ExpiresByType application/vnd.wap.wbxml "now plus 1 month"
ExpiresByType application/smil "now plus 1 month"
# Audio files expiration: 1 month after request
ExpiresByType audio/basic "now plus 1 month"
ExpiresByType audio/mid "now plus 1 month"
ExpiresByType audio/midi "now plus 1 month"
ExpiresByType audio/mpeg "now plus 1 month"
ExpiresByType audio/x-aiff "now plus 1 month"
ExpiresByType audio/x-mpegurl "now plus 1 month"
ExpiresByType audio/x-pn-realaudio "now plus 1 month"
ExpiresByType audio/x-wav "now plus 1 month"
# Movie files expiration: 1 month after request
ExpiresByType application/x-shockwave-flash "now plus 1 month"
ExpiresByType x-world/x-vrml "now plus 1 month"
ExpiresByType video/x-msvideo "now plus 1 month"
ExpiresByType video/mpeg "now plus 1 month"
ExpiresByType video/mp4 "now plus 1 month"
ExpiresByType video/quicktime "now plus 1 month"
ExpiresByType video/x-la-asf "now plus 1 month"
ExpiresByType video/x-ms-asf "now plus 1 month"
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
Сайты не кэшируют CSS и JS, их кэширует браузер, если веб-сервер проставляет им соответствующие заголовки. Но как я понял создаются файлы CSS и js в папке /cache, тогда единственное что приходит на ум, что есть софт на сервере или плагин, который обрабатывает CSS и JS (сжимает, объединяет) и поэтому уже кэширует результат, что разумно. htaccess тут не причем.


Виктор, вы правильно поняли - создается папка /cache в корневой системе сайта.
Т.е. поспрашивать хостеров, что с их стороны может создавать кеши?
*

Viktop

  • Захожу иногда
  • 97
  • 5 / 0
идет обращение к модулю mod_expires через файл .htaccess
ExpiresByType image/jpeg "now plus 1 month" - вот эта шляпа и задает кэширование

туплю, не про это вопрос похоже. Так а папку удалять пробовали? Создается опять?
« Последнее редактирование: 06.05.2016, 16:26:53 от Viktop »
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
идет обращение к модулю mod_expires через файл .htaccess
ExpiresByType image/jpeg "now plus 1 month" - вот эта шляпа и задает кэширование

туплю, не про это вопрос похоже. Так а папку удалять пробовали? Создается опять?

Конечно пробовал, она снова создается
*

SmokerMan

  • Гуру
  • 5293
  • 720 / 26
Rorschach
мы так мистически можем гадать очень долго, пока не увидим реальную ссылку
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
Rorschach
мы так мистически можем гадать очень долго, пока не увидим реальную ссылку

Вот реальная ссылка: https://tel-number.ru/
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
Будут еще варианты где Joomla по умолчанию генерит кеш?
*

Viktop

  • Захожу иногда
  • 97
  • 5 / 0
это?
/cache/template/mootools-core-34a97223.js
/cache/template/widgetkit-ebadf464-f7825ba2.js

это шаблон делает
*

Rorschach

  • Новичок
  • 9
  • 0 / 0
Спасибо, похоже таки да. И шаблон и еще один модель создает кеши.
Всем спасибо!
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Отключить скрипты для одной страницы

Автор mixis

Ответов: 5
Просмотров: 8263
Последний ответ 08.03.2019, 10:06:54
от Сергей Гончаров
Как отключить Joomla template and flash clock by Designers?

Автор Mira

Ответов: 21
Просмотров: 2374
Последний ответ 17.11.2018, 14:47:29
от Mira
Правильное кеширование

Автор Gerostrat

Ответов: 5
Просмотров: 1052
Последний ответ 23.08.2017, 14:10:04
от Gerostrat
Как отключить горизонтальный скорлл страницы?

Автор arut.karpetyan

Ответов: 1
Просмотров: 889
Последний ответ 05.03.2017, 09:11:30
от dmitry_stas
Избранные материалы - как отключить вывод в колонки?

Автор Olinda

Ответов: 5
Просмотров: 1393
Последний ответ 14.09.2015, 14:38:22
от Olinda