• Home
  • WP tuts
  • Hosting talk
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • Speed up wordpress
  • Pc world
  • Services
  • About Me

RAaz Kumar .com

wordpress tutorials seo hosting etc

how to enable KeepAlive connections in apache nginx wordpress

What is keep alive in apache & nginx

keep alive connections between browser and server for a certain amount of time seconds, defined amount of connections.
so server don’t need to establish a connection upon refreshing webpage in browser.
so we save CPU resources.
faster loading for client.

too many keepalive connections

a webpage requests 34-150 requests upoloan loading. based on. files for a wordpress 30-50 avg connections.
js,css,img,html etc. (here 4requests enough to load if you build static site like that)
Low requests low dns lookups, faster connection, lower page size.

How to enable keep alive connections in apache htaccess

apache allows allow rewritting rules, but nginx won’t.
So we can add a htaccess in domain top level directory.
but header modules has to enabled on the server.by default it will in shared, managed hosting.
In vps & cloud

Edit apache 2.conf

KeepAliveTimeout
KeepAlive on;
KeepAliveMaxConnections
reload apache server
service apache2 reload

How enable  keep alive connections in nginx?

by default it will enable.
you can add max connections
keep alive timeouts
another directive called keepalivedisable.
which disables the keep alive.
Context location; http,server, location.
reload or restart nginx .
systemctl restart nginx

enabling keep alive on wordpress?

check it enabled at server level by curl on online curl tools to view headers.
through htaccess
add htaccess to web directory.
Through plugin:
php can do better job printing headers.
so browser can understand it , stops closing connection, encouraged to cache resources.

Verifying KeepAlive connections ?

curl -I https://yourdomain.com
or Chrome devoper tools, f12
reload the page.
select network tab, all>> click on static file like domain.com/dir/file.css
check request headers
there it will be appears.
note: you cannot use add_header directive to print keep alive, there is no variable out there Unless you code it.
like $upstream_cache_status.
also read if modified since, last modified, etag.
browser caching, or caching headers.

KeepAlive effect on performance?

keeping connection alive costs servers threads to use memory & cpu,
apache mpm event module uses seperate threadpool for KeepAlive connections.
nginx threadpool introduced later to fix non synchronous blocking.
values too high or to low depends upon server size, application type, visits type. Measure & set, monitor and fix.

Related topics:

  1. Apache vs nginx (connection handling, modules, memory usage)
  2. enable caching in apache server (mod cache disk cache) vs fastcgi cache
  3. apache modules list (explained, enable disable)
  4. enable browser caching in wordpress apache nginx caching headers explained
  5. OPcache enable / configuration settings for wordpress nginx php-fpm ubuntu (How to enable)

tutorials

  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Devops Syllabus topics PDF
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
  • Vivek Bindra Videos Transcription (business strategy)
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)
    • what is If-Modified-Since HTTP header how to add to Wordpress website
    • htaccess tutorial tips for wordpress #redirect #leverage browser cache #Gzip #KeepAlive
    • apache modules list (explained, enable disable)
    • connect to server by SSH client Putty SFTP client winscp LAMP, LEMP nginx apache etc linux
    • Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4(Debian 9 & Ubuntu 18.04 lts)
    • apache performance tuning mpm-worker vs prefork vs event modules
    • enable caching in apache server (mod cache disk cache) vs fastcgi cache
    • how to enable KeepAlive connections in apache nginx wordpress
    • Cache control Header & expires headers How to set Properly
    • apache2 conf sample explained apache configuration file modules etc

 

PUBG Mobile Tips & Tricks

free fire how to play (a-z guide) guns, tips & tricks etc

Windows 10 tips & tricks

Pagespeed optimization

Pc building tips & tricks

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

Android studio tutorials

Gaming/ streaming tips

Airtel dth channel list

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2021 - All Rights Reserved Disclaimer & Privacy Policy