Welcome! Log In Create A New Profile

Advanced

Re: [ANNOUNCE] Tengine-1.2.2

January 24, 2012 01:05PM
Hello,

Joshua Zhu, I find http-concat module very useful indeed. Except there are a few minor issues that hopefully will be fixed in the new version(s):

1. It is not possible to define files from alternate folder followed by files defined by another folder, for example:

/jquery/??jquery.asmselect.css,ui.imageuploader.css,jquery.linkselect.css => works

but

/jquery/??jquery.asmselect.css,ui.imageuploader.css,jquery.linkselect.css,/site-default.css => doesn't work

(site-default.css resides in the root)

Suggestion is therefore if "/" is used as a prefix for consequent files, then treat this component as absolute URL

2. Some CSS files may contain relative links to images. However, when these CSS files are concatenated using http-concat from a page residing in a different folder, links to images will not of course work anymore, as they become relative to the current page. For example: "jquery-ui-1.8.17.custom.css" of the standard jquery library contains 8 links to images/* and of course they don't work.

We wrote our own PHP script to automatically parse CSS files and fix the url's by using the following perl regex:

$path = dirname($e['uri']);
// example: url(relative/path/to/file) becomes: url(/absolute/and/not/relative/path/to/file) within a CSS file
$buf = preg_replace('/(:?\s*url\s*\()[\'"\s]*([^\/\'"].*)[\'"\s]*\)/isU', '$1' . ($path == '/' ? '/' : $path . '/') . '$2)', $buf);

It doesn't seem to create a big processing overhead, since the files are read from disk anyway, and this only does a replace operation in the memory buffer. what do you say? would it be possible to implement?

Also, Antonio, you did a great job to distribute http-concat on git, but the link to download the archive does not appear to have a .gz/.zip extension, and, for example, in Gentoo distribution it creates problems when using "unpack()" function in its ebuilds, as it doesn't know what type of archive it is:

https://nodeload.github.com/perusio/nginx-http-concat/tarball/master

(doesn't end with ".gz")

Also, there is no version information.

Best regards

Andrejs
Subject Author Posted

[ANNOUNCE] Tengine-1.2.2

Joshua Zhu January 12, 2012 10:36AM

RE: [ANNOUNCE] Tengine-1.2.2

Richardson, Greg January 12, 2012 01:42PM

Re: [ANNOUNCE] Tengine-1.2.2

António P. P. Almeida January 12, 2012 01:46PM

Re: [ANNOUNCE] Tengine-1.2.2

Piotr Sikora January 12, 2012 01:54PM

Re: [ANNOUNCE] Tengine-1.2.2

António P. P. Almeida January 12, 2012 03:28PM

Re: [ANNOUNCE] Tengine-1.2.2

locojohn January 24, 2012 01:05PM

Re: [ANNOUNCE] Tengine-1.2.2

Joshua Zhu January 17, 2012 05:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
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