-
-
Notifications
You must be signed in to change notification settings - Fork 184
Description
Problem: When changes are made to any Liquid file in the project, they do not take effect immediately.
Steps to Reproduce the Issue:
-
Create a New ASP.NET Core Web App (MVC) Project using Fluid
- Install the NuGet packages:
Fluid
andFluid.MVCViewEngine
. - Add a controller and view, and create a view file named
Index.liquid
. - In the
Program.cs
file, add the following configurations:builder.Services.AddMvc().AddFluid(); builder.Services.AddControllersWithViews().AddFluid(); app.UseStaticFiles();
- Install the NuGet packages:
-
Add Docker File
- Include a Dockerfile in the project.
- Add the following key-value pair to the Dockerfile to enable file change detection:
ENV DOTNET_USE_POLLING_FILE_WATCHER=1
-
Build the Docker Image
- Use the following command to build the Docker image:
docker build -t your_image_name .
- Use the following command to build the Docker image:
-
Run Docker with Volume
- Run the Docker container with a volume for dynamic updates using this command:
docker run -p 5050:80 -v "dynamic_volume_path:/app/Views/:rw" your_image_name
- Run the Docker container with a volume for dynamic updates using this command:
-
Reproduce the Issue
- Navigate to any Liquid file in the project.
- Make text changes in the Liquid file.
- Open the application in a browser (at the specified port). Notice that changes do not reflect immediately; however, after waiting for approximately 5–10 minutes, the changes are visible.
Reason for the Issue:
When changes are made to any Liquid file in the project, it triggers a full rebuild of all files, which causes a delay of around 5–10 minutes before updates appear. This delay is due to the current configuration where any single file modification initiates a complete rebuild, which is influenced by the volume size.
Issue Details:
● Affected Files: Liquid files.
● Current Behavior: A single file change causes the entire codebase to recompile.
● Impact: Average delay of 7–8 minutes per change as Per volume size, which accumulates over multiple changes and significantly affects development speed.
Demo Web App : https://github.com/dhawaldenny/Fluid_Demo_WebApp
Sandbox : https://codesandbox.io/p/github/dhawaldenny/Fluid_Demo_WebApp/main?import=true&workspaceId=676874cf-90d2-4548-bef7-f3da912431ea
Note: The number of view files in the folder will increase the delay before changes take effect.
For example, if there are only 4-5 view files, changes will typically take 30 seconds to 1 minute to load. However, if there are around 100 view (Liquid) files, it may take up to 5 minutes for changes to take effect, even if only one file was modified.