Seiden Group
Modern Development & Open Source for IBM i
  • Link to LinkedIn
  • Link to Mail
  • Home
  • Seiden PHP+
    • Seiden PHP+
    • Install & Learn
    • SmartSupport
    • PHP Migrations & Upgrades
    • Success Stories
    • Free PHP Assessment
    • Documentation
    • What’s New (Changelog)
  • IBM i Services
    • Development
    • Training & Mentoring
    • Open Source Setup & Upgrades
    • SSL/TLS Install & Learn
    • Performance
  • Support
    • Open Source & PHP
    • VS Code for i
    • Developer Support
    • Support Success Stories
  • VS Code for i
    • Support
    • Training
    • Code for i Resource Guide
    • Getting Started Videos
    • Code for IBM i Fridays
  • Free Stuff
    • IBM i Strategy & Tips
    • PHP Upgrade Assessment
    • CNX Valence Assessment
    • VS Code for IBM i Resources
    • Code for IBM i Fridays
    • QCachegrind Download
    • PHP Toolkit for IBM i Resources
    • Qshell on i Library
  • Blog
  • About
    • About Our Team
    • About Alan Seiden
    • Speakers & Sessions
    • In the News
  • Contact
  • 201.447.2437
  • Search
  • Menu Menu

Seiden Group Blog

Speed Up Web Pages and APIs Using Apache’s mod_deflate

October 12, 2021/0 Comments/in Apache, APIs & Web Services, Performance /by Alan Seiden

Apache HTTP Server ProjectWhen we do performance assessments for web applications and APIs running on HTTP Server (Powered by Apache) for i, one of the first things we do is enable a powerful Apache extension called mod_deflate. Just as zipping up files on your PC saves space and accelerates file transfers, mod_deflate compresses output from your server before sending it over your network.

Does it really work? My tests show a speed improvement of 10 to 50 percent!

One reason Seiden PHP+ runs so fast out of the box is that we automatically turn on mod_deflate during PHP+ installation.

Content is compressed automatically, sent over the network to the browser or API client as usual, then automatically decompressed. By default, the gzip compression protocol is used. You can compress any text-based output, including HTML (whether plain .html files, output from RPG CGI programs, PHP, Node, Python, or other languages), Cascading Style Sheets (CSS), and Javascript (JS) — pretty much anything except compressed images and other binary formats.

Follow these easy steps to enable mod_deflate:

    1. Edit the appropriate Apache instance configuration file. Its location will depend on your web server instance name. For example, if your Apache instance is named MYSITE, then the file is likely to be located at /www/mysite/conf/httpd.conf. This is a simple text file, so you may choose from several editors: IBM’s HTTP Server Admin GUI at port 2001 (if *ADMIN is started), the WRKLNK/EDTF command, or your favorite text editor.
    2. Add the following two directives to httpd.conf’s main section (pound signs are comments):

    1
    2
    3
    4
    5
    # Load the extension that deflates (compresses) content
    LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
    # Specify what content to compress (example: html, json, css, javascript)
    # Make sure this directive has no line breaks; it should fit on one line in your .conf file.
    AddOutputFilterByType DEFLATE application/x-httpd-php application/json text/css application/x-javascript application/javascript text/html

     

    1. Use the Start TCP/IP Server CL command to restart your Apache instance (in this case, “MYSITE”).

    1
    STRTCPSVR SERVER(*HTTP) RESTART(*HTTP) HTTPSVR(MYSITE)

    Find out whether mod_deflate is enabled:

    If your site is public, you can type its URL into the box at https://www.giftofspeed.com/gzip-test/ to learn whether compression has been enabled, and how much bandwidth you saved. When I tested my site, seidengroup.com, I learned that compression was, indeed, enabled, reducing page size from 73,911 bytes to 15,171 bytes, quite a savings.

    If your site is not public, you can use your browser’s “developer tools” to check for compression. Instructions for Google Chrome’s browser are at https://www.conetix.com.au/support/article/how-to-check-gzip-is-enabled.

    Speed up your site or API with mod_deflate

  1. Smart developers may ask whether the dynamic compression/decompression causes any performance penalty. In my experience, any minor slowdown from on-the-fly compression/decompression is far outweighed by the benefits of smaller file sizes. Compression algorithms have been optimized over the years to be very fast.  I say, therefore, compress first and ask questions later!Try mod_deflate on your IBM i-based sites (and other sites) and let us know your results.
Tags: Apache, IBM i, performance, PHP
Share this entry
  • Share on Facebook
  • Share on X
  • Share on Pinterest
  • Share on LinkedIn
  • Share on Tumblr
  • Share on Reddit
  • Share by Mail
https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png 0 0 Alan Seiden https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png Alan Seiden2021-10-12 16:41:382025-11-05 08:58:10Speed Up Web Pages and APIs Using Apache’s mod_deflate
Alan Seiden

About Alan Seiden

Alan works to preserve your investment in IBM enterprise systems by designing and implementing modernization strategies that leverage your existing business logic.

With a passion ...Read More

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

SUBSCRIBE
Open Thinking
Monthly IBM i Strategy & Tips
  • This field is for validation purposes and should be left unchanged.

IBM i Development

  • RPG, COBOL, SQL, Node,
    PHP, Python, Valance, etc.
  • Modernization. Integration.
  • Web and API Solutions
  • Legacy Maintenance
    ...
LET'S GET IT DONE!

Recent Posts

  • Moving to IBM i 7.6? An SDA Alternative with VS Code and IBM Bob
  • What’s New with Mapepire Database Connector for IBM i
  • Do You Need IBM i Observability?
  • PHP 8.6 is Coming Soon to IBM i
  • Safer npm installation is on the way for Node.js (and all JavaScript)
  • Access Modern Security for IBM i and Connected Web Environments
  • IBM i: A Natural Platform for Agentic AI
  • PHP on IBM i in 2026: The Modernization Engine
  • Your “AS/400” Is a Modern IBM i Platform
  • MCP + AI for IBM i Teams (with a MongoDB example)

SEIDEN GROUP: Modern Development & Open Source for IBM i

Home   |   Seiden PHP+   |   IBM i Services  |   Support   |   VS Code for i   |   Free Stuff   |   Blog  |   Privacy Policy  |   Contact         201.447.2437

© 2026 Seiden Group, LLC
  • Link to LinkedIn
  • Link to Mail
Link to: Git for All Your Code Link to: Git for All Your Code Git for All Your Code Link to: Optimize Your IBM i Web Application Using FastCGI Link to: Optimize Your IBM i Web Application Using FastCGI Optimize Your IBM i Web Application Using FastCGI
Scroll to top Scroll to top Scroll to top