Giter Club home page Giter Club logo

css-js-booster's People

Contributors

santo007 avatar schepp avatar sirpepe avatar vvo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css-js-booster's Issues

image url in css

hi
is it possible to CSS image path "/booster/booster/../examples/example1/css/../images/header.jpg" is simplify like "/booster/examples/example1/images/header.jpg"

[ENHANCEMENT] Clean urls

Since we're planning to pass parameter by config files, why not now have calls to css and js files like this :

/CSS-JS-Booster/booster/css.md5.timestamp.datauri.css
/CSS-JS-Booster/booster/css.md5.timestamp.mhtml.css
/CSS-JS-Booster/booster/js.md5.timestamp.js

With help of htaccess of course it could also means that the web server could direclty read the files instead of calling a php script.

Apache can do rewrite rules to css.php or js.php only based on the fact that "does the file reall exists?" => yes => give it to me / no => call css.php or js.php based on file request

It would be safer i think.

I also know this is huge work but will definitely give css-js-booster a big advantage in the dynamic css js generation "world" :)

Bad path calculation to css-js-booster

Hi, i'm using css js booster but ran on a bug :

on http://mywebsite.com homepage, with http://mywebsite.com/CSS-JS-Booster present, all is OK.

When outputing ->css_markup(); the href of the css stylesheet is "CSS-JS-Booster/booster/.." then i go to http://mywebsite.com/page1/ wich is in fact redirected to http://mywebsite.com/index.php with a rewrite rule, this is a fake directory page.

In this cas, the href is still "CSS-JS-Booster/../.." but as we're on "http://mywebsite.com/page1/" browser will try to get "http://mywebsite.com/page1/CSS-JS-Booster" wich is not a valid directory...

How can i force the css js booster path if i know it ?

I think you should always write the full path to the css js booster, not a relative one

Cannot get any CSS files to work in a MCV setup

Hi,
I can't seem to get any CSS files to work in my site which has an MVC type structure. I suspect there's conflicting re-writes going on.

Javascript files work with some success i.e Jquery refuses to play nicely no matter what and isn't available to the libraries that need it, but a lot of other files do work fine.

Great bit of coding though!

Access to private files

With CSS-JS-Booster calls it is possible to access webroot and non webroot files like /etc/passwd or any php file that contains passwords and such.

In my fork i double check the file extension and file mime type (though javascript and css files doesn't have specific mime types...)

But i think the best would be to have configuration files (in json format) that stores the file groups, passing the files group to uri is very dangerous as said by zoompf http://zoompf.com/blog/2009/12/the-challenge-of-dynamically-generating-static-content.

And he's right because in default version of css js booster we can access the whole filesystem !

Duplicate data-uris bloat the CSS

If the CSS contains multiple references to the same image, CSS-JS-Booster currently embeds the image for each occurance. This can easily lead to a pretty large CSS file (or many chunks of it).

MHTML does not fall for this. but with data-uris I don't see a viable solution to reducing the overhead. The only way out is to skip images with multiple references. If the WebDev still wishes to make use of data-uris, he must modify his CSS accordingly.

Example does not work on 1.6.3

I downloaded the current 1.6.3 version and installed on our box (Ubuntu 9.10). I get an error at first requiring to create the booster-cache folder. I did. But the content of the .css file generated is just "css" and the javascript seem missing nearly all the code.

Fatal error when PHP is not run as Apache Module...

    // Checking if Apache runs with mod_rewrite, @dded by xod: When PHP is run as CGI Script this throws a fatal error, so I added the function_exists checking for the whole thing...
    if ( function_exists( 'apache_get_modules' ) ) {
        $apache_modules = apache_get_modules();
        if(in_array('mod_rewrite',$apache_modules)) $this->mod_rewrite = TRUE;
    }

just recognized that and changed it a bit, now it works =), maybe you want to implement this?

Look great, jsut need some extra spice.

I am the author of this question: http://stackoverflow.com/questions/3501295/packing-caching-js-and-css-in-php-that-differentiate-between-development-and-pr

I read a lot of articles and solution around. CSS-JS-Booster looks like the most close to what I need.

In order to get even better optimization read the question in stackoverflow

This is pretty much what you are missing:

1- Option to turn on/off debug mode.
2- To improve development of CSS styles support .less files compilation and use of LESS.js for debug and compiled version for not debug mode.
3 - Instead on using JSMin, use Google Closure Compiler that make a better job with Javascript.

When calling cssmarkup / jsmarkup, cachedir is not correctly set

When calling cssmarkup/jsmarkup, cachedir is still "booster_cache"

Since getwcd command on my system reports /home/http/nameofwebsite/www, error check pass and reports "booster_cache" is not a dir (right, it this in /home/http/nameofwebsite/www/CSS-JS-Booster/booster/)

But the next functions works because they call setcachedir.

Also how setting the cachedir is hard, i do not understand (trust me i'm lost, this is not free criticizing of your work).

Using booster_cache = realpath(dirname(FILE)).'/booster_cache' should do the work ?

--> --> in der Seitenausgabe

Hi Christian,
ich habe es gerade bereits bei Peter im Blog gepostet, aber will nochmal den offziellen Weg einschlagen. :-)

Nachdem ich den Booster als Plugin bei mir installiert und aktiviert habe haut es beim Aufruf der Seite oben den String "--> --> " raus ...
Seite: http://www.schnellkochtopf-rezept.de

Ich habe das Plugin erstmal wieder deaktiviert. Kann es aber durchaus wieder einschalten, wenn du es brauchst.

Ich hoffe, du kannst helfen ... :-)

Sonnige Grüße vom Bodensee
Jörg

Add last modified header to query string or a method for versionning

Case :
i update my css and js files, push the updates to server then remove the files in booster_cache.

If a client with a full cache (means that he already visited my website and have the file in cache because of max-age directives) goes to the website then he'll not get the new js and css files because he'll not ask for them as long as the number of seconds in max age has past.

What i ask is to have a versioning system like this : css.php?...&lastmodified=timestamp then the ressource will have the timestamp in his URI and if the timestamp changes the client will ask the ressource again.

[ENHANCEMENT] Pass parameters by config files

Query parameters are dangerous !

what happens when if i change "cachedir", when i change "hosted_minifier" etc...

Security is high concern and i do not want potential attacker to be able to generate a lot of files freely on the server.

Wrong datauri path generation in css_datauri_cleanup() ?

Hi! I'm currently working on integrating css-js-booster into an existing website that uses .css files scattered throughout its directory tree. I'm assigning an array containing paths to the .css files relative to the booster_inc.php to $booster->css_source. Also, I'm developing my website at http://localhost/~username/foobar, so I am setting $booster->base_offset and $booster->document_root, too.

Everything seems to work out fine, except for a wrong path calculation in css_datauri_cleanup(). In booster_inc.php:1144, $booster_path is calculated using the document_root object-property, which has never been set for this instance of the Booster class that executes this function. css_datauri_cleanup() is executed only on the instance which was constructed in booster_css.php, and naturally, that instance knows nothing of the
document_root I used when parameterising $booster in my website's files.

However, I don't think it's actually necessary to recalculate $booster_path. In my opinion, it should be enough to use the $dir paramter that gets passed in with a usable relative path anyway? So, in line 1169, instead of

$replace = $treffer[1][$i].$booster_path.'/';

it should be enough to say

$replace = $treffer[1][$i];

At least, that seems to work for me. What are your thoughts on this? Am I missing something?

Regards,
please keep up the good work!,

Fritz.

ps: same file, unrelated issue, line 1170: I guess it should read if (...) ... = $css_stringbase instead of ... $css_stringmode.

Remove query strings from css_markup and js_markup

When using query strings for ressources, it disable shared caching

http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

What i want is to have css and js files called this way : css/dir=hello1,salut2,hi&blabla=1&blabli=0 (i think & are allowed since minify does it like that)

Or why not trying json objects in query string, easier to parse ?

css/{"dir":["hello","hello2","hello3"],"blabla":0}

a bit weird but very easy to undertand

[ENHANCEMENT] Datauris ignore file

Problem :
You have a 404 page with a very large background (but < 24ko), jpg style
You have 2 css files : core + template.
You use css js booster to merge, minify and data uri your code. Then the large background is data uried and you have a BIG css file.

Solution :
When calling css markup, if we could provide a ignore file with on each line some characters like :

404
big
big_image

Then when css js booster parses the CSS file, when he find an image he wants to data uri, it has to check if the image uri does not contain one of the keywords of the ignore file

This could be an ignore file but an array or a string can do the work too.

I know this sounds a weird idea and that could be solved by making a css file only for the 404 page, then you lost the merging benefits.

What do you think ?

[WP] Not loading period.

I have tried loading your plug-in several times from source by downloading the WP specific plugin as well as V1.8 from here. I am scratching my head as to why this is not loading. I have attached my source code below.

Note: I have used the sample file on the same server and it works perfectly. I am excited to use the plug-in I hope you can give me some insight on why it may not be working.

Html source: http://pastie.org/1273362
Website: http://bit.ly/96q3ig

I am not utilizing any other plugins besides WP Importer.

Thanks in advance,

J Nolte

when mixing folders and files for source, getfilestime only parse first folder ..

Hi again :)

all is in the title,

i got one call with 2 folders then on unique file for css source
if i update the unique file i do not get the cache to update

i got a second call with only one css file for css source
if i update the file, the cache get updated

i think getfilestime only parse first folder .. just an idea hope it helps

Minify the HTML itself?

In my (smarty based) projects I usually include a small plugin to remove whitespace and comments from HTML as well. (yes, ignoring <script|blockquote|pre|..>, yes, without destroying conditional comments.) Where apllicable (and necessary) inline CSS and JS are minified to.

Most effort is put into optimizing CSS and JS. But once they've reached the client (and were fitted with proper HTTP-headers for caching), they are of no further concern. What about the HTML itself?

We've basically got 2 types of HTML. Static, (public-cachable) HTML and user-specific (private-cachable) HTML. The static parts behave just like CSS and JS once optimized and cached. But especially those not-public-cachable or not at all cachable parts benefit from deflating a lot.

Yes, this will not speed up page loads as drastically as reducing the HTTP requests. But over time you'll see your traffic plummeting. We did.

[ENHANCEMENT] Lock file when generating merged/minified files

Problem : on a high traffic website, there can be hundreds request to pages in one or two seconds.
If the generation takes more than 2 seconds then you'll launch a lot of css js booster file generation for nothing and the machine could crash (will crash)

Solution :
generating a lock file before doing the generation, when it's done delete the lock file
If the user ask for the files and the lock file is here, give it raw css and raw js with expires:now and max age 0
then the next page when the generating is done he'll get clean minified cached css and js

I know we already discussed the problem by DM but this is a reminder for both of us :)

Plugin versaut BadBehavior-Code

Hi Christian,

ich habe nun mit Mühen meine Seite http://www.schnellkochtopf-rezept.de wieder valide und bin dabei dahintergekommen, dass meine Probleme zum Teil auf CSS-JS-Booster zurückzuführen sind. Ohne das aktivierte Plugin validiert die Seite. Mit Plugin nicht.
Ich habe das Plugin mal aktiviert gelassen. Du kannst also mit dem W3C-Validator den Fehler sehen. Irgendwie beißen sich Comments mit dem BadBehavior-Code. Ist dein Plugin aktiviert und BadBehavior deaktiviert, validiert die Seite auch wieder. :-)

Viele Grüße vom verregneten Bodensee
Jörg

Files modified : nocache modified but i get the cached file

What behavior i expected :
i'm using hosted minifier (no debug mode), i have only one js files made of multiple folders/files.
If i modify one file : the nocache argument is changed (great) and the browser redo a request for the JS.

But the JS is automatically taken form the cache (altough on file have changed)

here are my parameters :
$js_files = 'folder/folder,folder2,folder2';
$booster->js_hosted_minifier = TRUE;
$booster->js_totalparts = 1;
$booster->js_source = $js_files;
$booster->booster_cachedir_autocleanup = FALSE;
$booster->js_executionmode = "defer";

it should do the same for css files

thanks

Can't deactivate the plugin

Hi Schepp,

I wanted to deactivate the CSS-JS-Booster plugin because CSS updates didn't take effect. After I clicked on "Deactivate" it started to load and after a few seconds a Wordpress "Service" Error occurred. This happend four times.

After that I removed the folder. In WP Plugin overview the plugin is gone but the css still seems to be in a boostercache file.

Can you help me?

example: http://quaeng.de/bilder-u4-tunneltour-u-bahn-tunnel-ueberseequartier-hafencity-jungfernstieg-hvv-verkehr-9212/

Regards

Patrick

can't activate

Hi, when I try to activate the plugin I get this error:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/graphi9/public_html/wellcore/wp-content/plugins/css-js-booster/booster_inc.php on line 88

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.