A simple cache warmer

I just created a cache warmer, hoping that it is useful to website administrators.

Cache warming: what is it?

Cache warming consists in “obliging” a website to put its web pages and other resources (images…) in cache, with the aim to speed up the page loading for the visitors of the website.

freezing

Cache warming: should we do it?

Probably not, if you are not ready to invest significant time. As this answer on StackOverflow discusses, managing the cache(s) of a web application is a complex thing.

Yet, this is a frequent requirement (“get the agency that manages the website to put in place a cache warmer”). I created a simple cache warmer to help someone who had this requirement. The solution is not sophisticated but it answers the requirement.

What does it do in practice?

  1. It takes a list of urls from the sitemap.xml of your website
  2. It visits each urls, twice: using the user-agent of a mobile device, and the user-agent of a desktop computer. The visit explicitly requests a cache refresh.
  3. When all urls have been visited, it pauses for a time (that you define). Then it starts again.

How to use it

  1. you need an access to a Linux server
  2. Java 17 should be installed
  3. Download this CacheWarmer-1.0.jar file and place it in a directory
  4. Place the files cache-warmer.properties and site-map-urls.txt in the same directory. Modify the values in these 2 files as you prefer.
  5. On the command line in the directory, do: nohup java --module-path . --module jcachewarmer/net.clementlevallois.cachewarmer.controller.Controller &

The cache warmer is now running continuously.

I am not a technical person, but I do have access to a Linux server. Can I run the cache warmer?

I could release a version of the cache warmer that does not need the installation of Java. It would be a zip file that you would unzip on your server, and a run.bat file to execute, that’s all.

Get in touch with me (analysis at exploreyourdata . com) if that would be interesting to you and you would be ready to invest a bit of time to test the solution.

Is it free, open source and licensed to allow commercial use?

Yes it is.

About me

I am a professor at emlyon business school where I conduct research in Natural Language Processing and network analysis applied to social sciences and the humanities. I teach about the impact of digital technologies on business and society. I build nocode functions 🔎, a click and point web app to explore texts and networks. It is fully open source. Try it and give some feedback, I would appreciate it!

 Date: September 25, 2023

Previous
⏪ A strategy for assessments in the age of ChatGPT

Next
Is ChatGPT Artificial General Intelligence? ⏩