{"id":1208,"date":"2021-10-15T07:33:05","date_gmt":"2021-10-15T07:33:05","guid":{"rendered":"https:\/\/inspiration.ie\/?p=1208"},"modified":"2023-11-09T16:31:53","modified_gmt":"2023-11-09T16:31:53","slug":"10-fixes-for-caching-problems-and-why-caching-matters-for-your-wordpress-website","status":"publish","type":"post","link":"https:\/\/inspiration.ie\/10-fixes-for-caching-problems-and-why-caching-matters-for-your-wordpress-website\/","title":{"rendered":"10 Fixes for Caching Problems. And Why Caching Matters for Your WordPress Website"},"content":{"rendered":"
When you think about caching, what comes to mind? If your answer is \u201cnothing\u201d then this post is for you. If it seems like a scary, complex tech issue, then this post is for you too.<\/p>\n
Many businesses often overlook the importance of caching and how it can be used to improve the performance of a website<\/p>\n
In this guide we will explain caching, go over some common types of caching problems and discuss how to address them.<\/p>\n
Ready? Let\u2019s go\u2026<\/p>\n
Caching involves saving copies of files in a cache, or temporary storage location, so that they can be retrieved more quickly e.g. by downloading a website quickly. Effectively the content\u00a0 is stored in a handy location so it doesn\u2019t have to travel far across the web.<\/p>\n
Websites are typically visited hundreds, thousands, or even millions of times each month. The server must perform a slew of complex (and time-consuming) computations whenever a browser requests a web page. It retrieves the most recent postings, creates the header and footer, locates your site’s navigation, sidebar widgets, and so on. Enter Caching. Caching makes the server remember the final result instead of having to go through this whole process from scratch each time you visit the same site.<\/p>\n
Caching data is crucial for optimising app performance and efficiency. It keeps data on your local device, so everything will appear quickly as you navigate through the pages on the site.<\/p>\n
There are a number of advantages to caching in WordPress. The fundamentals include:<\/p>\n
In the world of wordpress – there are two distinct kinds of caching technologies depending on the client-server model:<\/p>\n
1) Client-Side caching<\/p>\n
2) Server-Side caching<\/p>\n
A website’s static data, such as pictures, CSS and Javascript files, is non-textual. Your browser is clever enough not to re-download these files when you press the F5 key. It simply retrieves data from the local cache i.e., the one stored on your computer’s hard drive.<\/p>\n
This process of reusing the cached data from the client\u2019s computer (or client\u2019s end) is known as client-side caching and almost every modern website uses it and every browser supports it. Client-side caching saves server resources by preventing data redundancy (i.e. downloading the same data over and over again) and minimising data duplication (i.e. sending the same file to every user).<\/p>\n
Caching at the server is known as server-side caching. Server-side caching includes various caching protocols that are used e.g. for WordPress caching;<\/p>\n
1) Page caching<\/p>\n
2) Database query caching<\/p>\n
3) Object based caching<\/p>\n
4) Opcode caching<\/p>\n
This simply refers to keeping the dynamically created HTML files on the server’s hard drive or memory (RAM). It is also known as a cache. When a request is made, it will serve from the cache (i.e. reusing previously generated data) instead of executing PHP code and MySQL.<\/p>\n
More resources will be required to run the databases. Databases are crucial for efficiently storing, updating, and distributing data. As they\u2019re usually very large – each query takes time (usually in the order of a few hundred microseconds).<\/p>\n
In the case of databases, the better the hardware – the faster the query result generation. Because WordPress is so reliant on its database, it makes numerous queries. It’s like re-downloading the same photos when data isn’t changed in the database and queries are made to retrieve the very same information.<\/p>\n
In other words, saving the results of a query in the local storage will save time and resources. The end result of database queries’ results is local storage, which is known as database caching and this is one of the key components in WordPress caching. It’s necessary to delete and re-cache the database query results again when the database is updated, such as when a post is updated or published, or a comment is submitted.<\/p>\n
WordPress has an internal caching system which includes several subsystems (i.e. the Caching API, Object Cache, and Transient API). The WordPress core allows plugins to control this caching system to reduce the number of database calls.<\/p>\n
Like the database caching, opcode caching refers to the saving of the compiled PHP code between every request. PHP is an object oriented programming language. To execute a PHP program, the PHP compiler must first compile the code and generate executable web server code.<\/p>\n
With all great technologies, there are often hiccups along the way. Let\u2019s look at some of the most typical caching problems and how to address them.<\/p>\n
Problems specific to individual user’s device<\/u><\/strong><\/p>\n \u00a0<\/strong><\/p>\n Web Browser Cache for Specific User<\/strong><\/p>\n The most frequent caching problem is with a user’s web browser cache, which saves web files from previously viewed web pages on the local computer for quicker viewing of these sites in the future. The disadvantage of browser cache is that it may store out-of-date pages and associated files, such as CSS styles and JavaScript interactive scripts, causing unintended user experience. So basically the user is not seeing what they should be seeing on the site!<\/p>\n How to Identify<\/em><\/strong>:<\/p>\n The Issue is specific to a single computer that was previously used to visit the site in question, or multiple computers without any underlying similarities, such as a shared network.<\/p>\n Solution:<\/em><\/strong><\/p>\n This can be resolved by clearing browser cache and restarting browser.\u00a0Sometimes, even a simple hard refresh<\/a> without restarting a browser would suffice.<\/p>\n User\u2019s DNS Cache, Serving Old Page<\/strong><\/p>\n DNS entries can be saved locally and this might cause difficulties during testing or web site launch. This is also contextual and depends on the users operating system.<\/p>\n How to Identify:<\/em><\/strong><\/p>\n The problem is specific to a single computer that previously visited the website causing issues, or multiple computers on a shared network.<\/p>\n Solution:<\/em><\/strong><\/p>\n Flush local DNS cache prior to viewing changes or during web site launch.<\/p>\n User\u2019s Hosts File Pointing to Incorrect IP<\/strong><\/p>\n A typical testing approach for a new site prior to going live is via changes in local hosts file.\u00a0Hosts file allows creating a custom alias on a local machine between development URL (or IP address) and live domain name, so that the site in development can be viewed via a browser under its final domain name.\u00a0Occasionally, the local hosts file entry is left after testing, which would prevent a specific user from seeing the live site since the domain name will continue to point to the development site, just as it did throughout testing.<\/p>\n How to Identify<\/em><\/strong>:<\/p>\n Problem is with a single computer that had its hosts file edited.<\/p>\n Solution<\/em><\/strong>:<\/p>\n Can be resolved by quick edit to hosts file.<\/p>\n Network-wide issues, to be addressed by network administrator<\/u><\/strong><\/p>\n Caching on User\u2019s Local Network<\/strong><\/p>\n Network components, such as routers, can store cached DNS information.<\/p>\n How to Identify:<\/em><\/strong><\/p>\n Issue will be common to all computers on a specific network.<\/p>\n Solution:<\/em><\/strong><\/p>\n Turn off DNS caching or set dnsmasq to 0 names.<\/p>\n Caching on User\u2019s Internet Connection Provider<\/strong><\/p>\n Caching on internet provider side can occur if the provider uses proxy [server \/ router] for reducing external traffic.<\/p>\n How to Identify:<\/em><\/strong><\/p>\n Users in one particular geographical region serviced by a specific provider will see this message.\u00a0You can also use a service such as https:\/\/www.infobyip.com\/detectproxy.php to see if your provider uses proxy [server \/ router].<\/p>\n Solution:<\/em><\/strong><\/p>\n Contact the internet provider’s technical support and request specific web site (domain) to be either excluded from caching (included in do-not-cache list) or have its cached duration reduced to a bare minimum.<\/p>\n Web site issues, to be addressed by webmaster<\/u><\/strong><\/p>\n Caching on Web Server, WordPress or Other Framework with build\u2013in or modular Caching Feature<\/strong><\/p>\n Memory-intensive frameworks can easily overwhelm a web server with just a few concurrent site visitors.\u00a0To resolve this, many frameworks come with a caching feature that is either part of the core build or available as a module.\u00a0When enabled, caching makes a compiled version of all scripts, pages and styles available for web site visitors, without making individual server calls for every code asset used to generate specific pages.<\/p>\n How to Identify:<\/em><\/strong><\/p>\n Issue will appear on multiple computers without any underlying similarities.<\/p>\n Solution:<\/em><\/strong><\/p>\n Framework cache can be cleared or turned off via CMS.\u00a0But note that turning off framework caching is not recommended as it will severely impact the site\u2019s performance.<\/p>\n Hosting-related issues, to be addressed by web server admins and hosting support<\/u><\/strong><\/p>\n CDNs are used to reduce web server traffic and improve loading times for end user.\u00a0The issue with CDN might be lack of synchronisation with hosting server that has the most recent files and content.<\/p>\n How to Identify:<\/em><\/strong><\/p>\n Issue will be either geographically localised to one CDN serving specific region or widespread for multiple regions served by the same CDN provider. Can be identified by accessing web hosting server directly via IP and comparing content with that served via CDN.<\/p>\n Solution:<\/em><\/strong><\/p>\n CDN provider’s IT needs to force refresh content from web hosting server.<\/p>\n Caching By Load Balancer for Server Cluster<\/strong><\/p>\n Load balancer that directs traffic between multiple web hosting servers can have a caching feature configured and enabled.<\/p>\n How to Identify:<\/em><\/strong><\/p>\n All users accessing site through load balancer will see incorrect cached content, but accessing web server directly by IP will show correct content (might require temporarily disabling load balancer).<\/p>\n Solution:<\/em><\/strong><\/p>\n Server admin needs to either force refresh cache or reduce its duration.<\/p>\n \u00a0<\/strong><\/p>\n Secondary Server not Synchronizing Content with Primary Server<\/strong><\/p>\n When a primary server begins to reach its capacity, it mirrors its data to a secondary server, which can handle heavy web traffic when the primary server approaches its limits. If there’s an issue with mirroring files between servers, the secondary server will be serving different pages than primary server – even if content remains the same (for multi-server configuration, database will usually be handled on a separate server).<\/p>\n How to Identify:<\/em><\/strong><\/p>\n Issue appears for random users during high volume web site traffic, as some users are directed to secondary server with outdated web pages.<\/p>\n Solution:<\/em><\/strong><\/p>\n Restart and monitor mirroring process between two servers.<\/p>\n Upstream Caching by Hosting\u2019s Broadband Provider<\/strong><\/p>\n Caching of web files and DNS information can also occur at midpoints between user’s machine and hosting infrastructure.<\/p>\n How to Identify:<\/em><\/strong><\/p>\n Depending on the number of upstream providers, the issue can be consistent for all users (in case of a single broadband provider) or random (in case of more than one provider). It can usually be identified by server and network administrator by accessing web site internally from the data centre network and getting a different result when accessing the same web site externally.<\/p>\n Solution:<\/em><\/strong><\/p>\n Needs to be escalated by hosting provider to broadband provider’s tech support.<\/p>\n Here are some more typical questions that we get about Caching:<\/p>\n In general, we recommend against clearing your Browser Cache unless there is a compelling need. The files in the cache make your favorite websites load faster, which is a positive thing. Because your browser periodically erases old files, the cache isn’t going to keep expanding indefinitely.<\/p>\n Cache memory is\u00a0a type of high-speed random access memory (RAM)<\/strong>\u00a0which is built into the processor . Data can be transferred to and from cache memory more quickly than from RAM. Consequently, cache memory is used to temporarily hold data and instructions that the processor is likely to reuse.<\/p>\n A cache of recently downloaded Web pages is kept in memory or on disk and is used to store the most frequently viewed material. When you hop from web page to web page, caching those sites in memory allows you to quickly return to a site without having to download it from the Internet again.<\/p>\n You can clear cache or remove temporary files in your Windows settings:<\/strong><\/p>\n No, It will not delete any photos from your phone or computer.That action would require a deletion. What WILL happen is, the Data files that are stored Temporarily in your device’s Memory, thats the Only thing deleted once the cache is cleared.<\/p>\n By distributing query workload to multiple cheap front-end systems, caching improves scalability by removing demand on the backend. It allows flexibility in the processing of data; for example, the data of Platinum customers can be cached while that of ordinary customers are not.<\/p>\n DNS caching does not only occur\u00a0at the OS and browser level. It is more complex as DNS lookup involves various steps. During a new DNS lookup, the lookup passes through the resolver, root server, and TLD server. At each step, information is gathered and cached for later use.<\/p>\n As you can see there is more to caching than meets the eye. But when used in the correct fashion \u2013 it can improve your website speed and performance dramatically! If you would like to know more web development – get in contact with us.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":" When you think about caching, what comes to mind? If your answer is \u201cnothing\u201d then this post is for you. If it seems like a scary, complex tech issue, then this post is for you too. Many businesses often overlook the importance of caching and how it can be used to improve the performance of […]<\/p>\n","protected":false},"author":1,"featured_media":1209,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","footnotes":""},"categories":[51,53],"tags":[],"blocksy_meta":[],"acf":[],"yoast_head":"\n
\nCaching by CDN (Content Delivery Network)<\/strong><\/p>\nWordPress Plugins for Caching<\/strong><\/h2>\n
\n
\n
Is Clearing Cache Bad?<\/h2>\n
What is a caching in a computer?<\/h2>\n
Browser Cache<\/h2>\n
How do I empty the cache on my computer?<\/h2>\n
In Chrome<\/h3>\n
\n
Windows 10<\/h3>\n
\n
Will Clearing cache delete pictures?<\/h2>\n
When to use Caching database?<\/h2>\n
Where does dns caching occur?<\/h2>\n