<VirtualHost *:80>
    # ServerName ntsclinic.com
    # ServerAlias www.ntsclinic.com
    ServerAdmin input@juanfuent.es
    DocumentRoot /var/www/html/public

    RailsEnv production

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory "/var/www/html/public">
        Options FollowSymLinks
        Require all granted
    </Directory>

    <Location /assets/>
        Header unset ETag
        FileETag None
        ExpiresActive On
        ExpiresDefault "access plus 1 year"
    </Location>

    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE application/rss+xml
        AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
        AddOutputFilterByType DEFLATE application/x-font
        AddOutputFilterByType DEFLATE application/x-font-opentype
        AddOutputFilterByType DEFLATE application/x-font-otf
        AddOutputFilterByType DEFLATE application/x-font-truetype
        AddOutputFilterByType DEFLATE application/x-font-ttf
        AddOutputFilterByType DEFLATE application/x-javascript
        AddOutputFilterByType DEFLATE application/xhtml+xml
        AddOutputFilterByType DEFLATE application/xml
        AddOutputFilterByType DEFLATE font/opentype
        AddOutputFilterByType DEFLATE font/otf
        AddOutputFilterByType DEFLATE font/ttf
        AddOutputFilterByType DEFLATE image/svg+xml
        AddOutputFilterByType DEFLATE image/x-icon
        AddOutputFilterByType DEFLATE text/css
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/javascript
        AddOutputFilterByType DEFLATE text/plain
        AddOutputFilterByType DEFLATE text/xml
    </IfModule>

    <FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|webp|mp4|js|css|svg|woff2)$">
        Header set Cache-Control "max-age=2628000, public"
    </FilesMatch>

    <IfModule mod_expires.c>
        ExpiresActive on
        ExpiresDefault "access plus 1 week"
        ExpiresByType text/cache-manifest "access plus 90 seconds"
        ExpiresByType text/html "access plus 90 seconds"
        ExpiresByType text/xml "access plus 90 seconds"
        ExpiresByType application/xml "access plus 90 seconds"
        ExpiresByType application/json "access plus 90 seconds"
        ExpiresByType application/rss+xml "access plus 1 hour"
        ExpiresByType application/atom+xml "access plus 1 hour"
        ExpiresByType image/x-icon "access plus 1 week"
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
        ExpiresByType image/jpeg "access plus 1 month"
        ExpiresByType video/ogg "access plus 1 month"
        ExpiresByType audio/ogg "access plus 1 month"
        ExpiresByType video/mp4 "access plus 1 month"
        ExpiresByType video/webm "access plus 1 month"
        ExpiresByType text/x-component "access plus 1 month"
        ExpiresByType application/x-font-ttf "access plus 1 month"
        ExpiresByType font/opentype "access plus 1 month"
        ExpiresByType application/x-font-woff "access plus 1 month"
        ExpiresByType application/font-woff2 "access plus 1 month"
        ExpiresByType image/svg+xml "access plus 1 month"
        ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
        ExpiresByType text/css "access plus 1 week"
        ExpiresByType application/javascript "access plus 1 week"
        <IfModule mod_headers.c>
            Header append Cache-Control "public"
        </IfModule>
    </IfModule>

</VirtualHost>