fix: force caching headers for CSS and JS files with version strings
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -3,7 +3,7 @@ FROM php:8.2-apache
|
|||||||
# Modülleri aktif et
|
# Modülleri aktif et
|
||||||
RUN a2enmod rewrite expires deflate headers
|
RUN a2enmod rewrite expires deflate headers
|
||||||
|
|
||||||
# Apache Site Konfigürasyonunu doğrudan güncelle (Header ve Önbellek zorlaması)
|
# Apache Site Konfigürasyonunu doğrudan güncelle (CSS ve JS zorlaması ile)
|
||||||
RUN echo '<VirtualHost *:80>\n\
|
RUN echo '<VirtualHost *:80>\n\
|
||||||
DocumentRoot /var/www/html\n\
|
DocumentRoot /var/www/html\n\
|
||||||
<Directory /var/www/html>\n\
|
<Directory /var/www/html>\n\
|
||||||
@@ -19,11 +19,13 @@ RUN echo '<VirtualHost *:80>\n\
|
|||||||
ExpiresByType image/png "access plus 1 year"\n\
|
ExpiresByType image/png "access plus 1 year"\n\
|
||||||
ExpiresByType image/webp "access plus 1 year"\n\
|
ExpiresByType image/webp "access plus 1 year"\n\
|
||||||
ExpiresByType font/woff2 "access plus 1 year"\n\
|
ExpiresByType font/woff2 "access plus 1 year"\n\
|
||||||
ExpiresByType text/css "access plus 1 month"\n\
|
ExpiresByType text/css "access plus 1 year"\n\
|
||||||
ExpiresByType application/javascript "access plus 1 month"\n\
|
ExpiresByType application/javascript "access plus 1 year"\n\
|
||||||
</IfModule>\n\
|
</IfModule>\n\
|
||||||
<IfModule mod_headers.c>\n\
|
<IfModule mod_headers.c>\n\
|
||||||
Header set Cache-Control "max-age=31536000, public"\n\
|
<FilesMatch "\\.(css|js|jpg|jpeg|png|gif|webp|woff2|svg)$">\n\
|
||||||
|
Header set Cache-Control "max-age=31536000, public, immutable"\n\
|
||||||
|
</FilesMatch>\n\
|
||||||
</IfModule>\n\
|
</IfModule>\n\
|
||||||
</VirtualHost>' > /etc/apache2/sites-available/000-default.conf
|
</VirtualHost>' > /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user