WeeklyOSM/Webserver configuration

From OpenStreetMap Wiki
Jump to navigation Jump to search

trash bin

This page has been labelled for deletion.
The given reason is: outdated.

This normally means the page title is a bad one, and the content has been moved somewhere better. If a page title is vaguely meaningful, the page should perhaps be a redirect, or hold a small summary for historical interest instead. If you disagree with its deletion, please explain why on its talk page.
The page should now be empty apart from this message (as per procedure). The page history shows what used to be on this page, and allows people to rescue an old revision. We may decide to do this, but otherwise a wiki sysop user can delete this page more permanently at some point. In the meantime we should fix any pages linking to here.
Administrators: check links, talk, history (last), and logs before deletion
This page was last edited by Chris2map at 20:16, 31 October 2025 (UTC) (8 days ago)

.htaccess

Use browser to cache static assets

On both web servers include the following section to set caching in browsers correctly

 # BEGIN Cache Expire Headers
 <IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType application/javascript "access plus 1 week"
 ExpiresByType application/x-javascript "access plus 1 week"
 ExpiresByType image/gif "access plus 1 week"
 ExpiresByType image/jpeg "access plus 1 week"
 ExpiresByType image/png "access plus 1 week"
 ExpiresByType image/x-icon "access plus 1 week"
 ExpiresByType image/svg+xml "access plus 1 week"
 ExpiresByType text/css "access plus 1 week" 
 ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
 </IfModule>
 # END Cache Expire Headers

Compress text during transmission to the browser

Shared hosting on 1and1 does not offer gzip compression. blog.openstreetmap.de does and is controlled by the .htaccess file

# BEGIN Compress certain file types
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/vnd.microsoft.icon
</IfModule>
# END Compress certain file types