I'm building an Angular 8 application that collects user input and generates PDF files from it. I'm storing the generated files in a directory outside the web root and using a symlink to access them for display on the web page using ng2-pdf-viewer, e.g.:
In this URL, "pdfs" is the symlink to the folder where "my_report.pdf" was created. However, the file isn't found. If I copy/paste the above URL into the browser's location bar, the router treats it as a 404. The odd thing is, if I stop ng and restart it, then the URL works as expected. It appears that Angular is caching the state of the assets directory at start-up and not recognizing any new files added to it. I've spent a couple of hours searching for an explanation of this and the right way to handle such situations but came up empty. Does anyone here know if assets is cached or indexed on startup, and if so is there a way to force it to reload/reindex it when new files are added? If not, where is the proper place to store files created on the fly and how does one tell the router where to find them? Thank you.