Hello, Norbert,
first of all I want to introduce my situation a bit. I am IT sysadmin at a telecommunication who is responsible for setting up web servers. We also have the situation that customers load a site or a part of a site, say the CSS files or JQuery, a hundred times an hour whice is really not necessary. In the view of HTTP, caching is always an advice that is given from the server to the client. It is the client's responsibility (i.e. its specific behaviour to follow this advice) to really cache the files and not re-request them from the server. In HTTP 1.1, the caching is a simple HTTP header field, see section 14.9 here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html So, for example: Cache-Control: max-age=3600, public to advice the client a cache of 3600 seconds. You may want to
adjust the value to your needs. Since you do not want every file to be cached, you may want to put the header under a condition: <FilesMatch "\.mp4$"> Header set Cache-Control "max-age=3600, public" </FilesMatch> You can put this into the virtual host configuration file or into the .htaccess file.The FilesMatch directive is described here: https://httpd.apache.org/docs/2.4/de/mod/core.html#filesmatch and the string "\.mp4$" is a Regular _expression_ to match the file names.
Kind regards, rexkogitans
Am 16.06.19 um 09:53 schrieb Norbert de
Jonge:
|