What permissions(rights) should Magento 2 module
files/dir have in production environment? Can I use php functions that creates a file inside a module directory (fwrite)? I am considering writing db information to
js file so the module won't make too much db requests. But I am concerned if that might cause any security threats or be against Magento development best practices?
I am creating a autocomplete search form and association with that i am considering two options from three (the third that i have sorted out is xml file generation by php):
- Ajax call from database using
likewhen customer types to input field.
- When data has changed in db Cron runs php script that replaces or generates js file from new db information. The file would be located in module directory.
I have asked similar question before, but unfortunately I could not understand the answer what i got. Also i couldn't generate a question to ask that would have made the answer more clearer for me.