Coder Social home page Coder Social logo

pkg_scriptmerge's People

Contributors

alexandersk avatar chofoteddy avatar jissereitsma avatar morron-by-nature avatar piotr-cz avatar robobenklein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pkg_scriptmerge's Issues

Leverage browser caching

Hello again.
I found sometime and i am trying to find google page speed insights for a website with this plugin.
What i am getting from google is a "Laverage broswer caching" fix consideration for the css and javascript pages that are shown with 30 minutes caching time.

The settings:
Merge Type: File-list Dynamic
Hashing method: Advanced

Now what is the issue / s
I have a multy language site that requires dynamic hashing and thus these are the settings.
Since the htaccess doesnt see the .css or .js file type doesnt give these two files correct time to expire.

I tried to add the extensions manually in the plugin with no success, also this could be done perhaps via php from the components view as it gets called but i cant seem to find the view...
Any assistance / thoughts?

Edit: I tried editing the com_scriptmerge\helpers\helper.php without any results.

Dynamic Merge Type Inline Suggestion

Hello,

I would like to expand an the dynamic css and javascript generation, an issue that causes sometimes issues with caching of the scripts and errors or can just appear page speed suggestions in various engines.

What i would like to suggest and it would be nice to have your thoughts is to develop ( i can do it ) an alternative way to output the scripts and css via inline html witch could eliminate any such problems with the only side-effect the increased html size.

It could be easily implemented obtaining backwards compatibility by introducing a new option in the "Merge Type" option about Filelist ( dynamic - Inline).

What do you think?

PS i have not taken a look in the code about the required time in order to develop such an implementation but i believe it would not be so hard ;)

Discussion about onAfterRender isEnabledImg functionality

Hello,
i think it is better to state a few points here than another pull request.

First of all for the record and for general understanding the way the plugin works for images is that the function getImgMatches now( with the latest commit) gets all image sources, validates their write functionality and pushed them into an array with their respective width and height.

This array is used on the function onAfterRender that for the time being with the check isEnabledImg and each image source is replaced within the doc with str_replace function.

The issue:
Some plugins use the same image paths in multiple elements or placed that should not be replaced and thus brake the page or their functionality.

In order to solve this we may use many ways from some of them i have tested:
a) use within the str_replace an <img src= so we only target images.
The issues here are that not all of images have src attribute after img and anyway in general str_replace is not recommended for tampering with the dom.

b) The use of the $dom->loadHTML , $dom->saveHTML approach.
This way we tamper with the dom as we should but according to my tests the dom is tampered in many ways and whatever supported command i used to prevent it some javascripts broke.
In my tests one web site worked correctly while another with multiple javascripts had major issues.
So i suggest not working with this method while it is correct but it will cause significant issues.

c) Since php dom gives significance to proper html formatting and breaks some things we need a library that does not give importance to validated html.
Here comes the library: simplehtmldom* that supports tampering with html elements without the above issues. In my tests all web sites where working correctly and i am currently having one of them now live ;)
What is needed is to import the library and run 10 lines of code :)

d) Suggestion:
We could use an option in the settings and let the user choose how he would like to use the image functionality. Lets say:
Way a: old school with str_replace
Way b: Dom oriented.
That way we could support more websites and give administrators the capability to solve any technical glitches by their own.
28-1-2016 Ps. we can also make an option not to change the height and width of any image if it has already been set...
I can provide a latest demo with the changes if you wish.

I will be waiting for your opinion and thoughts.
Edit 29-1-2016 Any thoughts?

Javascript Compression without Merge

Hello i hope me message finds you well.

I would like to state that after a generic speed opt test i found out that in the case a website may have the option"Merge Js" to No then the compress Js option is ignored and any script that is outputted is not compressed at all.

Is this a normal / intended behavior?
In my opinion compression should be set and operate with and without script merging both on the merged scripts and on each script that is not merged separately.

You may test any website using the google page speed tool:
https://developers.google.com/speed/pagespeed/insights/
You will notice the scripts are outputted with the same level of compression always.

CSS above-the-fold content

What would you think if we would implement support to automate the creation of css above the fold content? I can see there is a library that will do: https://github.com/pocketjoso/penthouse
Many wordpress plugins exist for that use too. I believe only one plugin (not open source) supports this in joomla platform.

I would like your thoughts :)

CSS Min Library

Hello,

Regarding the option Compress CSS through using CSSmin i have to say that for all the websites i have used so far they all break the css in an important factor. I did check in the forum and saw the whole consent has started since 2013 and the plugin is in the latest version 3.0.1 but it has not been updated since 2011.

Link Preload Headers have issues

There seems to be a small issue in the preload header generation, an extra / is added after the domain, causing the browser to treat the same merged CSS as two different sources.

In the HTTP Header:
image

But then in the page's html:
image

The extra / in the preload header causes Chrome to preload it, but then re-download since it thinks the url in the html is different, hence it also gives this warning:
image

I think this shouldn't be too hard of a fix right?

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.