AIT WEB DESIGN - изработка на сайт и СЕО оптимизация

  • Начало
  • Услуги
    • УЕБ САЙТ ИЗРАБОТВАНЕ
    • Изработка на One Page и Landing Page сайтове
    • WordPress Разработки
    • ПОДДРЪЖКА НА WORDPRESS САЙТ
    • ЕЛЕКТРОННИ МАГАЗИНИ
    • Изработка на онлайн каталог
    • Изработка на сайт за недвижими имоти
    • Изработка на портфолио сайт за художници, фотографи и творци
    • ПРЕВОД НА УЕБ СТРАНИЦИ
    • ИЗРАБОТКА НА ЛОГО
    • ОПТИМИЗАЦИЯ НА САЙТ
    • СОФТУЕР ПО ПОРЪЧКА
    • БЕЗПЛАТЕН САЙТ
  • ХОСТИНГ И ДОМЕЙН
    • Партньорска програма за уеб агенции
  • ЗА НАС
  • ПОРТФОЛИО
  • РЕФЕРЕНЦИИ
  • МАГАЗИН
  • БЛОГ
  • КОНТАКТИ
  • Начало
  • Wordpress
  • Archive from category "Wordpress"
  • Page 4
05.04.2026

Category: Wordpress

Как да оптимизираме скоростта на WordPress чрез конфигуриране на кеша на браузера в .htaccess файла

  • 0
afilipov
петък, 03 юни 2016 / Published in Wordpress, Код оптимизация

Първо спираме ETag header-а тъй като ще използваме EXPIRES CACHING:

# ----------------------------------------------------------------------
# Expire Header
# ----------------------------------------------------------------------

# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset UTF-8
# Force UTF-8 for a number of file formats

AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml


# FileETag None is not enough for every server.

Header unset ETag


# Since we’re sending far-future expires, we don’t need ETags for static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None

# Send CORS headers if browsers request them; enabled by default for images.


# mod_headers, y u no match by Content-Type?!

SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS




# Allow access to web fonts from all domains.


Header set Access-Control-Allow-Origin "*"






Header set X-Powered-By "WP Rocket/2.8.14"
Header unset Pragma
Header append Cache-Control "public"
Header unset Last-Modified





Header unset Pragma
Header append Cache-Control "public"




# Expires headers (for better cache control)

ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault                          "access plus 1 month"

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest       "access plus 0 seconds"

# Your document html
ExpiresByType text/html                 "access plus 0 seconds"

# Data
ExpiresByType text/xml                  "access plus 0 seconds"
ExpiresByType application/xml           "access plus 0 seconds"
ExpiresByType application/json          "access plus 0 seconds"

# Feed
ExpiresByType application/rss+xml       "access plus 1 hour"
ExpiresByType application/atom+xml      "access plus 1 hour"

# Favicon (cannot be renamed)
ExpiresByType image/x-icon              "access plus 1 week"

# Media: images, video, audio
ExpiresByType image/gif                 "access plus 1 month"
ExpiresByType image/png                 "access plus 1 month"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType video/ogg                 "access plus 1 month"
ExpiresByType audio/ogg                 "access plus 1 month"
ExpiresByType video/mp4                 "access plus 1 month"
ExpiresByType video/webm                "access plus 1 month"

# HTC files  (css3pie)
ExpiresByType text/x-component          "access plus 1 month"

# Webfonts
ExpiresByType application/x-font-ttf    "access plus 1 month"
ExpiresByType font/opentype             "access plus 1 month"
ExpiresByType application/x-font-woff   "access plus 1 month"
ExpiresByType application/x-font-woff2  "access plus 1 month"
ExpiresByType image/svg+xml             "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
ExpiresByType text/css                  "access plus 1 year"
ExpiresByType application/javascript    "access plus 1 year"



# Gzip compression

# Active compression
SetOutputFilter DEFLATE
# Force deflate for mangled headers


SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
# Don’t compress images and other uncompressible content
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp)$ no-gzip dont-vary



# Compress all output labeled with one of the following MIME-types

AddOutputFilterByType DEFLATE application/atom+xml \
		                          application/javascript \
		                          application/json \
		                          application/rss+xml \
		                          application/vnd.ms-fontobject \
		                          application/x-font-ttf \
		                          application/xhtml+xml \
		                          application/xml \
		                          font/opentype \
		                          image/svg+xml \
		                          image/x-icon \
		                          text/css \
		                          text/html \
		                          text/plain \
		                          text/x-component \
		                          text/xml


Header append Vary: Accept-Encoding



# ----------------------------------------------------------------------
# Fonts
# ----------------------------------------------------------------------
# Add correct content-type for fonts 
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml
# Add a far future Expires header for fonts
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType font/ttf "access plus 1 year"
ExpiresByType font/otf "access plus 1 year"
ExpiresByType font/x-woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"




Remove Query Strings

Добавете следния код в function.php (WordPress)

function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

Сумиране на поле от „Advanced Custom Fields“ по дадена категория.

  • 0
afilipov
петък, 03 юни 2016 / Published in Wordpress, Код оптимизация
function get_cat_count_downloads_by_cat($cat_id){

global $wpdb;
$total_downloads = $wpdb->get_col($wpdb->prepare
("SELECT meta_value FROM wp_postmeta as pm
INNER JOIN wp_term_relationships as tr ON (pm.post_id = tr.object_id) 
INNER JOIN wp_term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) 
WHERE 1
AND tt.term_taxonomy_id = '".$cat_id."'
AND pm.meta_key = 'mp3_downloads'"));
	return array_sum( $total_downloads );
}

Премахване на URL структура от „custom post type“

  • 0
afilipov
четвъртък, 26 май 2016 / Published in Wordpress, Код оптимизация

Когато регистрирате нов тип пост „custom post type“ във вашия function.php има опции rewrite, query_var, publicly_queryable, public. Те трябва да изглеждат така:

'rewrite'            => false,
'query_var'          => false,
'publicly_queryable' => false,
'public'             => false

От WordPress документацията:

rewrite Triggers the handling of rewrites for this post type. To prevent rewrites, set to false.

query_var 'false' - Disables query_var key use. A post type cannot be loaded at /?{query_var}={single_post_slug}

publicly_queryable Whether queries can be performed on the front end as part of parse_request().

public 'false' - Post type is not intended to be used publicly and should generally be unavailable in wp-admin and on the front end unless explicitly planned for elsewhere.

Сега отивате в „Permalinks Settings“ или ако сайта Ви е на български „Постоянни връзки“ и без да променяте нищо натиснете запазване на промените, което ще презапише настройките.
С това действие ще забрани достъпа до вашия „custom post type“ от предната част на сайта.

Дебъгване на WordPress: Намиране на бавни Filters и Actions

  • 0
afilipov
петък, 11 март 2016 / Published in Wordpress, Код оптимизация
  • 1
  • 2
  • 3
  • 4

Търсене

Категории

  • CSS
  • SEO Оптимизация
  • WooCommerce
  • Wordpress
  • WordPress Модули
  • Код оптимизация
  • Трикове

Архиви

  • февруари 2026
  • юли 2020
  • юли 2018
  • февруари 2018
  • август 2017
  • март 2017
  • ноември 2016
  • октомври 2016
  • септември 2016
  • август 2016
  • юли 2016
  • юни 2016
  • май 2016
  • март 2016
  • юли 2012

AIT Web Design

Готови ли сте за нов уеб сайт?

  • Безплатна консултация
  • Индивидуален подход
  • Реални резултати
Безплатна консултация

УСЛУГИ

  • Изработка на уеб сайт
  • Онлайн магазин
  • ОПТИМИЗАЦИЯ НА САЙТ
  • Поддръжка на WordPress сайт
  • ХОСТИНГ И ДОМЕЙН
  • Всички услуги

ВРЪЗКА С НАС

Работим с клиенти от цяла България
(+359) 888 898 797
Email: office@ait-webdesign.com

AIT WEB DESIGN
6300 Хасково, Ул. Хан Аспарух 9-11. България

Отвори в Google Maps

Полезно

  • За нас
  • Портфолио
  • Услуги
  • Референции
  • Блог
  • КОНТАКТИ
  • Политика за защита на личните данни

Всички права запазени AIT WEB DESIGN 2026

НАГОРЕ