• Skip to main content
  • Skip to primary sidebar
  • Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

You are here: Home / wordpress tutorials for beginners advanced complete guide to run WordPress / enable browser caching in wordpress apache nginx caching headers explained

enable browser caching in wordpress apache nginx caching headers explained

Table of Contents

Toggle
  • what is browser caching?
  • How browser know which type of content & how long?
  • enabling browser cache in wordpress by w3tc?
  • Don’t forget to Gzip access encoding Gzip
    • nginx add header last modified, if modified since won’t works?
  • enabling browser caching in nginx?

what is browser caching?

browser stores static files css.js,.jpg in local to avoid downloading it from server every time a page refreshes.

 

How browser know which type of content & how long?

then it commes to http headers so browser & server communicates with these.

caching headers like

cache-control

expires

Last modified

if modified since

not only browsers proxy severs also respect it.

 

caching validity for static resources

css js png jpg etc won’t change so frequently. settings it minimum upto 7 days or 365 days max.

content type html/TXT

Tell browser not to cache or cache for 1 hour.

based on your content changing frequency.

fastcgi cache, w3tc plugin we generally set for 1 hour html content.

disabling it also better. user may not read the again 1 hour. If you date it uses won’t notice changes because it’s served from local.

he has to clear browser cache or shift+reload to clear specific page.

 

enabling browser cache in wordpress by w3tc?

 

wordpress dashboard>>performance>>

browser caching.

html & XML

Css /js

images

expires header

etag

cache control

if modified since

added to your htaccess in apache

In nginx a file will be created nginx.conf

rules will be added there , but you have to link

the directory conf file to server block by include directive.

then reload nginx

nginx -s reload to effect the changes.

 

Don’t forget to Gzip access encoding Gzip

 

by default it will be,

you can enable by htaccess mid deflate in apache,

Gzip by default added in nginx.conf

it saves lot of bandwidth. Ex your page size 7MB. after Gzip it will be 2-3MB.

you need 2.5x cpu,ram for serving same content without Gzip or brotil.

 

nginx add header last modified, if modified since won’t works?

unless you set a variable it cannot print last modified, & if modified since.

you simply place

Last-Modified exact;

If-Modified-Since exact;

in http & server, location blocks.

better results place it location block where content differentiate,

we need different cache approaches for different content types.

 

enable browser caching in apache server level

modules to verify

mod header

mod deflate

Mod expires

 

enabling browser caching in nginx?

 

place directives in any of the location block

if_modified_since exatct | before |off;

default value off

Last_modified exact;  default exact; (you won’t need to add unless yiu disable it or customize)

etag on; default off;

expires 30d; default off;

add_header cache-control public; must-revaliate,no transform etc ( additional to expiry to controlling whoom to cache proxy or browser )

sample

if_modified_since exact;

last_modified exact;

etag on;

expires 30d; //place this in static content location block.

Also read

page caching,

object caching,

Keep alive connections

if modified since

htaccess tutorials /codes

nginx rewrite rules

Primary Sidebar

wordpress tutorials for beginners advanced complete guide to run WordPress

  • wordpress speed optimization Speed up wordpress Score on Google pagespeed
  • best wordpress plugins social, seo, Backup, speed up your blog
  • TOP 10 Wordpress Themes Premium/ Free & providers
  • Wordpress Adsense Plugins & Manually
  • Social share buttons for website Wordpress Blogger
  • How to bulk delete in wordpress posts, pages, Media Images, tags and categories
  • TOP 5 Best wordpress comment plugins 2020 (disable pingback, replytocom, customize form)
  • all in one seo pack vs yoast seo pressor
  • Auto post to Facebook, twitter, Google Plus Wordpress Posts 2019
  • wordpress plugins that slow down your site and its alternatives
  • How to use wordpress tags and categories
  • Wordpress duplicate thin content Issues {FIXED}
  • how to increase wordpress memory & file upload size
  • combine rss feeds wordpress
  • Reduce the impact of third-party code ,optimize JS delivery, Minify, remove unused js, pre connect, inline, lazy load etc
  • change wordpress site url internal links in mysql command phpmyadmin
  • install wordpress on ubuntu nginx lemp command line apache debian
  • Wordpress Security Plugins 2021 (Brute force, Login lockdown, Malware scanner etc)
  • website cache best caching plugins wordpress w3tc cloudflare
  • How to add adsense amp ads to wordpress
  • wordpress password reset in 3 ways mail, phpmyadmin, mysql command
  • how i recovered hacked website site 5 times ft wordpress?
  • wordpress redirection examples Rankmath seo
  • enable browser caching in wordpress apache nginx caching headers explained
  • W3TC w3 total cache plugin setup guide review comparison with wp rocket and wp super cache
  • Wordpress database optimization (don't neglect) plugins & phpmyadmin manually
  • Optimize css delivery inline critical css, remove unused css, render blocking css
  • Converting WordPress into static website speed after 1 second dynamic 3 seconds
  • Wordpress errors and fix
  • Rules to get 100/100 in Google pagespeed web core vitalsscore
  • Install xamp & wordpress on localhost windows
  • favicon ico Change / Add / Disable favicon in wordpress Ft Genesis Theme or any theme
  • increase wordpress memory limit (how to ) 40MB , 64 MB 128 MB or 512 MB maybe 1024MB
  • wp cron job check working or not disable enable change schedule
  • google analytics plugins for wordpress #sitekit #monsterinsights gadwp back as gainwp
  • Lazy Load Adsense to improve core web vitals - Vs revenue
  • xmlrpc php wordpress uses, disable without 403 error log message
  • wordpress 304 header implement using plugin
  • wordpress change post date programmatically (auto on update like blogger
  • sorry you are not allowed to access this page. admin WordPress options table
  • clone wordpress in linux ubuntu server lemp nginx
  • Cloudflare cache rules for WordPress along with page rules cache level everything
  • wordfence-waf.php fatal error fixed after migration
  • Cloudflare page rules cache level everything redirect and sub domain
  • wordpress delete all posts from database mysql query for phpmyadmin
  • php fpm oom killer problem how to dig it.. memory pool and execution time
  • nginx wordpress multisite subdirectory multiple domains
  • Helpful Content update recovery Trying to dig it
  • How to Move a Single WordPress Site into a Multisite
  • Enable multisite in wordpress in 3 steps problems datbase error
  • Seprate single site from wordpress multisite domain based
  • Error establishing a database connection wordpress multisite
  • Add single wordpress to MultiSite wordpress
  • genesis theme cateogory customization examples
  • could not insert term into the database. wordpress
  • wordpress breadcrumbs not showing full path
  • There has been a critical error on this website fed up
  • Site structure WP categories vs sub pages or multisite posts or pages
  • WordPress pyramid structure Permalinks Category vs sub pages vs multisite

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy