Contact Number

+919501010103

Email Address

contact@oxosolutions.com

Social Icons
OXO Solutions® Logo for Website
Empowering small to large businesses since 2008

Fulfilling all your IT needs at single stop
CIN: U74999PB2016PTC045616​GSTIN: ​​03AACCO3599B1ZO

  • About
    • Mission
    • Vision
    • Our Branding
  • Solutions
  • Services
  • Products
  • Research
    • Web
    • Website Speed Optimization
    • Progressive Web Applications
    • Big Data
    • Artificial Intelligence
    • Internet of Things
    • Web Application Security
  • Portfolio
    • E-Commerce
    • Graphics
    • Logo Design
    • Web Design
    • Web Development
    • SEO
    • Software Development
    • CMS Customization
  • CSR
  • Resources
    • Frequently Asked Questions
  • Happenings
  • Events
  • Support
  • Career
    • Current Openings
    • Apply Online
    • Internship
    • Life at OXO
  • Blog
  • Partners
  • Contact

How to Fix the Warning of Specify a Cache Validator?

How to Fix the Warning of Specify a Cache Validator-oxo-solution-digital-marketing-sompany

Analyzing the report of the website using Pingdom, GTmetrix, or Google PageSpeed Insights is common. But the problem arises when we are trying to fix the warnings. One of the warnings in the performance report is "Specify a cache validator" which landed you on this article. 

This article will surely quench your thirst for the solution you are looking for. 

Point to be noted.

Before starting, there is something you need to know that is, you can only fix this if request are on your server. But if you are using a 3rd party request then you are unable to control their web servers. In this case you are free to share the article link with the concerned party.   

Why warning of Specifying a Cache Validator occurs?

This arises due to missing HTTP cache headers which need to be included on every origin server response. It is important because it validates and sets the length of the cache. When headers are not found, it will generate a new request for the resource every time, and thus increases the load on your server.

What happens if you utilize a caching header?

It ensures that subsequent requests don’t have to be loaded from the server and thus it will save bandwidth and improve the performance for the user. 


You may also like to read:- Fix Leverage Browser Cache for Images, CSS and JS


How to fix the warning "Specify a cache validator"?

To fix the issue you need to know four types of headers. Two headers fall in the same category, namely the last-modified header and Etag header. These are used to validate the cache, which means they check the last modification made in the file. Next two headers, namely Cache-control and Expires help to determine how long the file should be held in the cache. 

Last-Modified Header

  • This header is usually sent by the server automatically, so there is no need to add it manually. It checks if the file was modified since the last time it was requested and checks if it needs to get the newer version or can load from the local cache. You can see the value of last modified in the header of the Pingdom or ChromeDevTools. 

ETag Header

This header is also similar to the last-modified header. It also validates the cache of a file. This identifies the version of the file with a string of characters. Whenever changes occur in the file a new version of the Etag is generated. It is a type of fingerprint and sometimes used to track the server. This tag is automatically added to the Apache 2.4 or higher using the FileETag directive. Since 2016, Etag is enabled by default

Cache-Control

  • This defines the length of the cache. The properties associated with it are max-age, s-maxage, max-stale, min-fresh, stale-while-revalidate, stale-if-error, and cacheability (public, private, no-cache, no-store). 
    • Public: It shows that any cache can store the response.
    • Private: It means it is cacheable only by the browser accessing the file.
    • Max-age: It defines the amount of time for which it is cacheable.

As in the above example, it can be seen that the max-age directive is 604800 seconds which is equal to seven days. 

To configure this in Apache, add the code below to  your .htaccess file. 

<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">Header set Cache-Control "max-age=604800, public" </filesMatch>mg src="picture.jpg" />

To configure this in NGINX, add the code below to your config. File. The files are located in the /etc/nginx/ directory and the primary configuration file is /etc/nginx/nginx.conf.

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { add_header Cache-Control "public"; }

Expires

This is the last step and can be skipped if cache-control is properly set up. The difference between the two headers is that cache control lets you define the period of time before the cache expires and whereas expires uses a date. 

To configure in Apache, use below code:

## EXPIRES HEADER CACHING ##

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType image/jpg "access 1 year"

ExpiresByType image/jpeg "access 1 year"

ExpiresByType image/gif "access 1 year"

ExpiresByType image/png "access 1 year"

ExpiresByType text/css "access 1 month"

ExpiresByType application/pdf "access 1 month"

ExpiresByType application/javascript "access 1 month"

ExpiresByType application/x-javascript "access 1 month"

ExpiresByType application/x-shockwave-flash "access 1 month"

ExpiresByType image/x-icon "access 1 year"

ExpiresDefault "access 7 days"

</IfModule>

## EXPIRES HEADER CACHING ##"

To configure in Nginx, 

"location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 7d; }"

Conclusion - Warning to Specify a Cache Validator

This article describes all the details essential to fix the warning related to "Specify a cache validator".  Hopefully, you enjoyed this article and learned everything you need to know about the cache validator. 

Post navigation

Previous
Next

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may also Like

  • Saikhom Mirabai Chanu wins first medal for India at Tokyo 2020 Olympics
  • Avoid an Excessive DOM Size: How to Fix this Warning?
  • 14 Steps Guide to Create an Effective SEO Strategy In 2020
  • The Top 25 Do’s and Don’ts of SEO You Need to Know
  • What Are Backlinks in SEO and What Are The Advantages of Backlinks
  • Google Changed Gmail Logo: Here’s What Changed Made So Far?
  • What is Social Media Marketing, and Why Social Media is Important for Business?
  • Combine Images Using CSS Sprites
  • Why Website Speed is Important? How to Optimize Website for Fast Speed?
  • How to Do Keyword Research for SEO

Share on social media

  • Facebook
  • Google Plus
  • LinkedIn
  • twitter
Follow Us

Quick Links

  • Home
  • About
  • Research
  • CSR
  • Resources
  • Happenings
  • Support
  • Career
  • Blog
  • Partners
  • Payment Methods
  • Contact

Services

  • Website Designing
  • Web Development
  • Software Development
  • Ecommerce Development
  • Digital Marketing
  • CMS Customization
  • Search Engine Optimization
  • Logo Design
  • Graphics Design
  • Infrastructure as a Service
  • Workforce as a Service

Solutions

  • Healthcare Solutions
  • Corporate Branding
  • Education Solutions
  • Project Consultancy
  • Digital Marketing
  • Research & Analytics

Products

  • Human Resource Management
  • Customers Support
  • FB Auto
  • Live chat
  • Enterprise Resource Planning

Portfolio

  • E-commerce
  • Logo Design
  • Web Design
  • Web Development
  • SEO
  • Software Development
  • CMS Customization

©2025 OXO Solutions®. All rights reserved.

Copyright Right
  • Privacy Policy
  • Terms and Conditions
  • Refund Policy