Koha Hacks: How To Enable Apache Caching On A Koha Library System Server (running Ubuntu 20.04LTS)
Is your Koha server taking too long to catalog or checkout items? Before you break the bank and purchase a bigger server with bucket-loads of RAM and processing power, enable Apache caching on your Koha ILS server instead – you might just save yourself a lot of time and money!

Koha Hacks: How To Enable Apache Caching On A Koha Library System Server (running Ubuntu 20.04LTS)

Is your Koha server taking too long to catalog or checkout items? Before you break the bank and purchase a bigger server with bucket-loads of RAM and processing power, enable Apache caching on your Koha ILS server instead – you might just save yourself a lot of time and money!
Enabling Apache Caching on Koha ILS
Just like Memcached, enabling Apache Caching will increase your Koha web server’s speed and reduce the overall load on your server.
1. Install Apache Cache
sudo apt update
sudo apt install apache2-utils
2. Enable Apache cache modules
sudo a2enmod cache
sudo a2enmod cache_disk
sudo a2enmod expires
sudo a2enmod headers
3. Restart Apache Web Server
sudo systemctl restart apache2
4. Update Koha’s Virtual Hosts Configuration
sudo nano /etc/apache2/sites-available/library.conf
Scroll to the bottom of the file and add the following lines just before line </VirtualHost> in both your OPAC and staff virtual host sections.CacheQuickHandler off
CacheLock on
CacheLockPath /tmp/mod_cache-lock
CacheLockMaxAge 5
CacheIgnoreHeaders Set-Cookie
CacheEnable disk
CacheHeader on
CacheDefaultExpire 800
CacheMaxExpire 64000
CacheIgnoreNoLastMod On
ExpiresActive on
ExpiresDefault A300
Save and Exit the file.
Note: You can set the CacheQuickHandler on or off. If it is set to on, then when requests are made to the server, the cache will be checked first without consulting Apache. This will make your server faster but it’s a bad idea if you need users to be logged in or authenticated first before they can access data (which I assume will be the case for most libraries). I recommend setting it to ‘off’ so that Apache can still authenticate users before serving content.
5. Test Apache Configuration
Test Apache configuration to check that there are no errors.
sudo apachectl configtest
6. Restart Apache Web Server
If there are no errors, restart Apache web server to enable cache.
sudo systemctl restart apache2
7. Test Apache Cache
You can test if the Apache cache is working by viewing the contents of directory where the cache is stored. The size of these directories and the number of files in them will grow with with time.
ls -la /var/cache/apache2/mod_cache_disk/
Tweaking Your Koha Library Server
Pro Tip: You should regularly check Koha’s Home > About Koha page. It gives you a quick overview of your server information. If there are any errors, missing applications or dependencies that might be slowing down your server, they will show up here. Now, read on to find out how to make the most of Koha library system.

Speed is of the essence in today’s world so it’s important you optimize your Koha library system server to ensure your patrons and staff can do their work quickly and efficiently. Did you have any trouble following this tutorial? Let me know in the comments and if you need help, don’t hesitate to get in touch.
Koha Support provides hassle-free Koha installation and cloud hosting as well as training, data migration, customization and technical support. Check out our packages and start your free trial today!
Follow to get the latest posts!
[et_social_follow icon_style=”slide” icon_shape=”circle” icons_location=”top” col_number=”auto” outer_color=”dark”]
How To Perform Post-Installation Checks On Koha Library System
Ensure your system is correctly set up and ready for use. This guide will guide you through the steps to perform these checks. Log into your Koha instance. Navigate to the "About" page.. You will see crucial information about your Koha instance, dependencies, and...
How to Complete Koha Library System’s Post-Installation Setup
This guide will help you set up your Koha Library System after launching it on Amazon Web Services (AWS) Marketplace. 1. Retrieve the Koha Administrator Password Log in to your AWS account and navigate to the EC2 dashboard. In the EC2 console, select your new...
How to Install Koha Library System on Ubuntu Server 20.04 LTS
Koha is the most popular open source library management system in the world. Learn how to install Koha on Ubuntu Server 20.04 LTS and join thousands of libraries using Koha around the globe.
7 Reasons Why You Need an Integrated Library Management System
Running a library isn’t as simple and straightforward as many people I have encountered think. It’s more than just checking out books and putting them back on the shelf when they are returned. Librarians have to deal other complex, time-consuming responsibilities like acquisitions, cataloguing, inventory, budgets, reports and interlibrary loaning. Pen and paper won’t cut it, and using an excel spreadsheet is only marginally better than digging a trench using a caviar spoon.
Koha Hacks: How to Install the Koha Offline Circulation Plugin
What do you do if your Koha library system suddenly goes offline due to a server crash, power or internet outage? Go back to the dark ages and start writing with pen and paper? Surely not! Koha has a very useful feature called Offline Circulation which allows you to...
Why Koha May Not Be The Best Library System For You
Here are some potential disadvantages of using Koha ILS: Steep learning curve: Koha can be challenging to set up and customize, especially for those who are not familiar with open-source software or the underlying technology. Lack of commercial support: Koha is a...
What Are The Most Popular Library Systems In The World?
Most popular library systems Libraries are essential for preserving and providing access to information, knowledge, and culture. Library systems help manage the catalog, circulation, and general administration of a library. With the rise of technology, library systems...
Top 10 Courses For Librarians Cost Duration Links
Here are the top 10 best courses or degrees for librarians, along with cost and average duration information and links to some programs: 1. Master of Library Science (MLS) - This is the most common and widely recognized degree for librarians. The average cost of a MLS...
Top 10 Courses For Librarians Cost Duration
Here is the average cost and duration for each of the top 10 courses or degrees for librarians: 1. Master of Library Science (MLS) – The cost varies depending on the institution and location, but on average, the cost is between $15,000 to $35,000. The duration is...
The Top 10 Degrees To Earn For A Successful And Higher Paying Career As A Librarian
1. Master of Library Science (MLS) – This is the most common and traditional degree for librarians, it provides a comprehensive education in library and information science, including cataloging, reference, information technology, and library management. 2. Master of...
[Solved] How to Backup Your Koha Library System MySQL Database
How to backup a MySQL database, including Koha
Koha Hacks: Why You Should Use Content Delivery Network (CDN) For Koha Library System
Is your Koha server taking too long to catalog or checkout items? Before you break the bank and purchase a bigger server with bucket-loads of RAM and processing power, you should try setting up a content delivery network (CDN) using a free service like CloudFlare...
Koha Hacks: How to Enable Plack on Koha Library System (Running On Ubuntu 20.04LTS)
Is your Koha server taking too long to catalog or checkout items? Before you break the bank and purchase a bigger server with bucket-loads of RAM and processing power, enable Plack instead - It will make your server much faster, and you might just save yourself a lot...