Skip to main content

Object cache problem of the AMP plugin for WordPress

If you are looking for one solution to the fix object cache problem of the WordPress AMP plugin displayed in dashboard from Site health; in this article I will show You how to do this in five minutes. Usually this situation arises when the installed theme is non an official theme and You have not cache plugin installed; anyway don't worry! We will solve the problem in a moment.

Object cache problem of the AMP plugin for WordPress
Object cache problem of the AMP plugin for WordPress

Why is important to enable persistent object cache for AMP 

Accelerate mobile page (AMP), is latest technology of the Web. An amp page load very fast compared to to a standard Web page and Google search engine like very much this; so you can improve the ranking of your site and get more mobile users traffic.

Persistent object cache

If persistent object cache is enabled, WordPress work better; the images and files as CSS will loaded more fast. Every WordPress Hosting have a cache service, otherwise it would be very strange and I recommend that you consider changing it.

Object cache Site Hearth Warning of the AMP plugin for WordPress
Object cache Site Hearth Warning of the AMP plugin for WordPress

How to fix object cache problem of the WordPress AMP plugin 

Before to start for security reason create a WordPress  backup copy! Then Download from the Root of the your Server via FTP or file manager the .htaccess file; then open it with your text editor and go to the end of the file. Insert the following code after this code comment #END WordPress but note that this code at moment is not tested for WordPress 6 and later :  

## BASIC EXPIRES CACHING FOR AMP WORDPRESS PLUGIN ##
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
## EXPIRES CACHING ##

Now save the .htaccess file and upload it in the root of your server. If You have installed Yoast plugin is not necessary to do this procedure by ftp, because You can do this from your Admin Panel. Now create a cache directory into wp-content with the same method used before (create cache directory in local host and upload via ftp or  create it from Your C-Panel, that's it!

AMP plugin for WordPress
AMP for WordPress plugin

Enable persistent object cache for AMP plugin through Yoast

It's very sample to change .htaccess file with Yoast, if  You ave this plugin installed; go to Your WordPress Dashboard click on:
  1. SEO
  2. Tools
  3. htaccess
  4. Edit the file
  5. Save
End! At this point, site health should report the status of your WordPress site in everything ok. If you still get the error, then try another AMP plugin and report everything to your hosting support.

Comments

Popular posts from this blog

The origins of computer programming

Modern computers can process large amounts of data. Before the current computers we can only refer to the analytical machine of Charles Babbage; This machine performed calculations thanks to the rotation of gear wheels. Countess Ada Lovelace participates in the creation of Charles Babbage's analytical machine by decoding the language to make it work; US Department of Defense dedicates the ADA programming language in the name of the Countess.  The role of women in computer science  Apparently, the position of women in the history of computer programming seems to cut out only a marginal role; in reality, it is not so! As already mentioned in the previous paragraph; without the contribution that Countess Ada Lovelace left to the world of information technology; this science could be decades behind. The origins of computer programming languages  The origins of programming languages were determined by a mechanical and mostly experimental approach; with reference to the an...

Learn to use the computer

Many people use the PC every day to connect to the network and to work but without knowing what the computer is and wondering how this is possible. We put a computer to work every time we buy with a credit card, withdraw from an ATM, pay a postal order, buy a train ticket, play video games and many other things. Understanding how the PC works inside is too much but starting from its components and the origins of  IT is already a good start. Learn to use the computer Basic computer components The computer is made up of several electronic components on printed circuits that interact with each other via micro pulses; if you want to learn how to use the computer, the main components of a PC are: A central processing unit (CPU); the "processor" used to process active processes on the data before outgoing transmission. RAM memories (random access memory) in which the bytes for processing are loaded; it is the dynamic memory of the computer and it is volatile; A graphics processing...

Introduction to the JavaScript language

In this introduction to the JavaScript language we discover one of the programming languages that has changed the concept of understanding the Web. The added value of JavaScript to the HTML code is to make the Web page dynamic in its interactions with the user. JavaScript is a client-side web programming language. Web 2.0 was born with the JavaScript language. The advantages of the JavaScript JavaScript or "JS" in its abbreviated form; is the most widely used client-side scripting language on the web. The advantage of the JavaScript is that it can be interpreted by almost all browsers; while what has allowed a strong expansion is the availability of many frameworks and libraries that can be easily integrated into scripts. The language is unique in its kind for data exchange thanks to the asynchronous AJAX (Asynchronous JavaScript and XML) functions that allow you to interact with users without reloading web pages and to exchange data in JSON (JavaScript Object Notation) for...