Copilot commented on code in PR #3178:
URL: https://github.com/apache/apisix-dashboard/pull/3178#discussion_r2280846650


##########
vite.config.ts:
##########
@@ -83,6 +84,10 @@ export default defineConfig({
     react({
       plugins: [observerPlugin() as never],
     }),
+    compression({
+      algorithms: ['gzip'],
+      deleteOriginalAssets: true,

Review Comment:
   Setting `deleteOriginalAssets: true` removes the original uncompressed files 
entirely. This could cause issues for clients that don't support gzip 
compression or for development/debugging scenarios. Consider setting this to 
`false` to keep both compressed and uncompressed versions available.
   ```suggestion
         deleteOriginalAssets: false,
   ```



##########
e2e/server/nginx.conf:
##########
@@ -19,13 +19,13 @@ server {
   listen 6174;
 
   location /ui {
-      rewrite ^/ui$ /ui/ permanent;
+    rewrite ^/ui$ /ui/ permanent;
   }
 
   location /ui/ {
     alias /usr/share/nginx/html/;
-    index index.html;
-    try_files $uri $uri/ /ui/index.html;
+    gzip_static always;
+    error_page 404 /ui/index.html;

Review Comment:
   The removal of `try_files $uri $uri/ /ui/index.html;` and replacement with 
`error_page 404 /ui/index.html;` changes the fallback behavior. The original 
`try_files` directive handles SPA routing more comprehensively by trying 
multiple paths before falling back, while `error_page 404` only handles actual 
404 errors. This could break client-side routing for the SPA.
   ```suggestion
       try_files $uri $uri/ /ui/index.html;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to