Isa Kniess 31 May, 2023
Why doesn’t my new content show? How do I clear the cache?

In "There is always a bottleneck. What is a Cache?", we explain just what a cache is.  The short answer is that a cache is a storage area that stores copies of files and content.

When you view a web page, your browser will first look in your local browser cache. If it believes it has a copy of the content requested, your browser will use that.  Your browser then reaches out to the internet for any expired or missing content.

In many cases today, your request is sent to a proxy server.  The proxy server will check for a local copy of the content your browser is requesting. If it has a copy in cache, it will forward that content to your browser.  If the proxy server does not have a copy of the content requested, or it is expired, it will forward the request to the web server.

The web server will receive a request, either from a proxy server or directly from your browser. It will check to see if it has a copy of the content in its cache that has not expired.  If it has a copy, it sends it back to your browser, possibly through a proxy server.  If not, it will get the content from your website.

Your website then starts to construct your requested content from cached content plus dynamic content.  If any of the cached content has expired, it will request the site rebuild that content.

 

But tell me what I need to do!

As a content creator, when you update your website you must tell the website and all other caches that the content they have on hand is no longer up to date.

New content doesn’t normally suffer from caching issues. It just hasn’t been cached anywhere yet, so it is created.  

Let’s take a specific example.  You have an image on your site which is called “CEO-HeadShot.jpg.”  You have just replaced it with a new image with the same name.  You reload your webpage, and discover that nothing has changed!

Because the file name is the same, all of the caches between your website and your browser that already have the image think that it is current.

When you upload images, sometimes the upload uses a date other than today's date and time.  Because of this, when the different protocols check to see if the file has changed, they don’t see the change because the date is older than the time the image was last cached.

You need to clear caches.

In general, you want, as a content creator, to clear the Drupal Cache on your site: 

Flush Drupal Caches

1. Log into your Drupal website 
2. Hover over the Drupal symbol
3. Click on flush all caches

Next, you want to clear the cache in your proxy server.  One common tool is Varnish, but there are others. At Twel, we use Varnish for most of the websites we support.

To clear your Varnish Cache for your site:

For Pantheon-hosted websites:

Clean caches Pantheon-hosted sites

1. Go to https://pantheon.io/
2. Log in with your credentials
3. Click on Any Enviroment
4. Click on the Clear Caches button on the top left side of the website

 

For Acquia-hosted websites: 

Clean caches Acquia-hosted websites

1. Go to https://accounts.acquia.com/ 
2. Log in with your credentials
3. Click on Any Enviroment
4. Click on the Actions button on the top left side of the website
5. Click clear caches


These instructions are for particular platforms using particular caching proxy servers.  If it is not covered here, please reach out to a Twel Representative. We have extensive experience with most caching proxy servers and hosting platforms.

Once you have cleared those caches, you should reload your page. If it still doesn’t show the new content, you will have to clear your local cache.

The first thing to try is a forced reload.  

A forced reload causes your page to reload all the content on that page, ignoring any of the content that is cached.

On Firefox and Chrome, there is a refresh button that looks like this:

Chrome Refresh


The circle with the arrow is the refresh button.  If you click that, it will reload the current page using cached content.  If you hold down the SHIFT key while clicking it, it will do a forced reload ignoring anything that is cached.

When you use Safari, the button looks like this:

Safari - Refresh

Which works the same.

On Internet Explorer, the button looks like this:
Internet Explorer - Refresh

If that doesn’t work for you, as some browsers don’t allow for a forced reload/refresh, you will need to go into the browser settings.

Within the browser settings, you are going to look for “cache” or “clear.”  This will bring up the location or setting needed to manage or clear data and cookies.

Be aware that if you clear/delete your “cookies” you will be logged out of the site and will need to log back in, if login is required.

We hope this information was helpful to you!

If you ever have questions about managing caching for your website, please feel free to reach out to your Twel Representative for assistance.