How do I eliminate header in PHP + Apache? I am currently using an auto_prepend service to serve resources, but I would also like to maximize HTTP cache.
How do I set it?
There are two ways to do this. Firstly, specify the header in your PHP code. It's great if you want to periodically adjust programmatically. For example, the wiki can end the time period for one page, which is not very often edited
header ('expiration': GMDATE ('D, Dm Y H : I: s \ g \ m \ t ', time () + (60 * 60))); // 1 hour Your second choice is to create a .htaccess file or modify your httpd configuration. In a shared hosting environment, modifying your .htaccess file is quite common. To do this, you should know whether your server supports mod_expires , mod_headers or both is the easiest way to just test and error, but some Apache server You are configured to view this information through the / server-info page if your server has both mod_expires and mod_headers, and you want to set static resources at the end, then insert it in your .htaccess file Try:
Turn on Exchange and set default 0 Turn on xp to set default cache on media files for # 1 (forever?) & Lt; FilesMatch ". (| | ExpiresDefault A29030400 Header Cache-Control" Public "Attach & lt; / FilesMatch & gt; For other combinations and more examples see:
< / Div>
Comments
Post a Comment