Welcome! Log In Create A New Profile

Advanced

Preload Files Module for Nginx

September 24, 2015 09:31AM
Send your relevant portfolio [past modules made] and a quote to develop and test this module. I will be posting it under my github account for easy access for myself and anyone else that needs it. I won't compromise on the functionality I've requested below even 1 centimeter.

This module "ngx_preload_files" preloads one or more files on the filesystem into a single variable. This can be used for tasks like concatenating critical css and javascript files and inlining them with a substitution module, all within Nginx.

All parameters accept variables in the standard format. This is implemented with a minimal memory and zero performance footprint; all the heavy lifting happens when nginx configuration loads/reloads.

== Directives ==

Syntax: preload_files $variable $files [file1 file2 file3 ...];
Default: —
Context: http, server, location

Loads $files into $variable. If any $file is a URI, pull in files with wget or cURL [whatever is available on the system].

---

Syntax: preload_files_context_local $path;
Default: — in server context, $document_root in server context, $uri in location context;
Context: http, server, location

The relative path/context for local preload_files [within this directive's and child contexts without overrides].

Set to "off" (without quotes) to resolve all $files as absolute paths.

---

Syntax: preload_files_context_remote $url;
Default: —
Context: http, server, location

The relative $url for remote preload_files [within this directive's and child contexts without overrides].

---

Syntax: preload_files_separator $separator;
Default: "\n";
Context: http, server, location

Defines the separator between preload_files [within this directive's and child contexts without overrides].

---

Syntax: preload_files_substitute $search $replace [$file];
Default: —
Context: http, server, location

Search and replace in $files prior to placing contents in $variable [within this directive's and child contexts]. This directive can be used multiple times for different search and replace operations.

If optional third parameter $file is passed, search/replace only occurs within that file; $file must *exactly* match it's preload_files $files entry.
Subject Author Posted

Preload Files Module for Nginx

vbresults September 24, 2015 09:31AM

Re: Preload Files Module for Nginx

vbresults September 24, 2015 09:36AM

Re: Preload Files Module for Nginx

chris-breda September 27, 2015 11:16AM

Re: Preload Files Module for Nginx

Frederik Nosi September 28, 2015 11:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 239
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready