Author Topic: Apache config file 'empty.conf' is turning Varnish unusable?  (Read 667 times)

0 Members and 1 Guest are viewing this topic.

Offline
***
Apache config file 'empty.conf' is turning Varnish unusable?
« on: December 13, 2023, 02:13:11 AM »
I tested if the varnish cache is working in my installation, like per tutorial here:
https://wiki.centos-webpanel.com/varnish-cache-test

But I checked the varnishd server is not working at all.

The file '/usr/local/apache/conf.d/empty.conf' is making varnish, nginx, Cloudflare, etc, unusable?
Has anyone else had this type of problem?

This configuration file is adding some Apache headers, to tell the proxies not to store cached pages, and asking them to fetch a new page from the server.
The headers are as follows:

File '/usr/local/apache/conf.d/empty.conf':
Code: [Select]
   (...)
    <filesMatch "\.(js)$">
        Header set Cache-Control "private"
    </filesMatch>
    <filesMatch "\.(x?html?|php)$">
        Header set Cache-Control "private, must-revalidate"
    </filesMatch>
   (...)

From google:
=============================================
Cache-Control: Private - The private response directive indicates that a resource is user specific—it can still be cached, but only on a client device. For example, a web page response marked as private can be cached by a desktop browser, but not a content delivery network (CDN).
=============================================
Cache-Control: must-revalidate - Indicates that once the resource is stale, a cache (client or proxy) must not use the response to satisfy subsequent requests without successful validation on the origin server.
=============================================

In other words, this configuration file is completely disabling caching for varnish, nginx, Cloudflare, etc.
Does this just happen to me, or is anyone else having this problem?

Regards,
Netino