7 Answer(s)
-
0
-
0
Hi @Astech
You can create a copy of https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Mvc/Proxying/AbpServiceProxiesController.cs with a different name and use it in your app.
By the way, 59MB seems very high, could you try minifying it first via query parameters ?
-
0
Hi ismcagdas, thanks for your reply.
It is 55mb when minified which is still crazy to be loading on every page load.
I can create a custom controller but how will this help with caching/load times?
Thanks Scott
-
0
We have resolved the issue by generating the file only once on application start. Saving it in the wwwroot and referencing that instead. This is allowing the file to be cached:
public void GenerateScripts() { var output = GetAll(new ApiProxyGenerationModel() { Minify = true, Type = "jquery" }); string fullFileLocation = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Common\Scripts", "AbpServiceProxies.min.js"); using (FileStream fs = new System.IO.FileStream(fullFileLocation, FileMode.Create)) { StreamWriter writer = new StreamWriter(fs); writer.Write(_javaScriptMinifier.Minify(output.Content)); writer.Close(); }
Thank you to **apchenjun **for his solution on this thread: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/5379
-
0
Hi @Astech
Thank you for sharing the solution here as well.
-
0
Is there anything else we can do about the size of this file? It just seems to be a list of all our app services. The solution I have provided above allows it to be cached, however, it is still a very large file to be loading on initial load.
Thanks
-
0
Hi @Astech
Currently, there is no optimization point but if you can create an issue on https://github.com/aspnetzero/aspnet-zero-core, we can try to enhance this feature.