I have a javascript file (with an .aspx extension) which is generated at runtime. It changes less than once per hour, generally. My goal is to include this javascript file in part of an existing CompositeScript on the server to reduce the number of server requests by 1. Yes, this is probably a bit crazy; I still wonder if it is solveable. I don't mind if it potentially ends up becoming out of date by an hour or so as a side effect of whatever I do to accomplish this.
Thus far, I have come up with 3 ways to solve this problem, none of which I like:
- Give up on it. Either don't use the script or have it be in a separate file.
- Use Server.Execute to include all the composite scripts inside this aspx file to create my own "compositescript." This is a stupid idea, but I'm mentioning it for completion.
- Have the server occasionally generate a static file containing the results of executing this file, and include that in the composite script. This works, but adds a bit more complexity and maintenance to the application, so I don't like it.
Any ideas?