Order of Apache rules for static caching wrong?
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- php
- Área
- documentation
Línea de trabajo
Open the static caching documentation at the Apache section linked in the issue and compare the documented rewrite rule order with the reporter’s working configuration. Confirm the intended behavior for cached files and live previews, then update the example if the ordering is wrong; done when the Apache example includes the correct rules and the missing IfModule wrapper.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On https://statamic.dev/static-caching#apache it shows .htaccess rules for redirecting to the static files. I believe the order these lines is wrong and therefore never hits the actual cache files.
This is in the docs:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} !live-preview
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} live-preview
RewriteRule ^ index.php [L]
RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteCond %{REQUEST_METHOD} GET
RewriteRule .* static/%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
</IfModule>
I kept receiving this message in Laravel logs:
Static cache loaded [..url..] If you are seeing this, your server rewrite rules have not been set up correctly.
I changed it to this, and now the message does not show up anymore:
<IfModule mod_rewrite.c>
RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI}_%{QUERY_STRING}\.html -s
RewriteCond %{REQUEST_METHOD} GET
RewriteRule .* static/%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} !live-preview
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} live-preview
RewriteRule ^ index.php [L]
</IfModule>
I also added the missing IfModule starting tag. I would happily make a merge request, but I wanted to check if I am not missing something obvious as I don't see any issues raised by other users about this.
- Lenguaje dominante
- PHP
- Estrellas
- 133
- Forks
- 405
- Merge medio
- 21 h 45 min
- PR fusionados (30 d)
- 12
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de statamic/docs
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Chunked UploadsAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Installation / Deployment Guides
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 40/100
Los mantenedores suelen responder en 1 día
-
Document how conditions treat empty and null valuesPosiblemente ocupada @joshdaugherty la tomó hace 14 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de statamic/docs
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
woocommerce/woocommerce-google-analytics-integration#699 ·
Los mantenedores suelen responder en 1 día
-
Sidebar highlights two items when plugin routes share a prefix (/plugin/foo and /plugin/foo-bar)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
getgrav/grav-plugin-admin2#195 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ProfessionalWiki/NeoWiki#1675 ·
Los mantenedores suelen responder en 1 día
-
Incorrect documentationAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100