+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Store library and plugin remotely via CDN

  1. #1
    Senior Member
    Join Date
    Dec 2011
    Posts
    159

    Question Store library and plugin remotely via CDN

    If I want to store my Library and plugin remotely thru a Content Delivery Network Services

    Should i be changing this:

    define( 'RL_LIBS', RL_ROOT . 'libs' . RL_DS );

    or

    define( 'RL_LIBS_URL', RL_URL_HOME . 'libs/' );

    or both?


    ================================================== ======


    // system paths
    define( 'RL_DIR', '' );
    define( 'RL_ROOT', '/home/xxxx/public_html' . RL_DS . RL_DIR );
    define( 'RL_INC', RL_ROOT . 'includes' . RL_DS );
    define( 'RL_CLASSES', RL_INC . 'classes' . RL_DS );
    define( 'RL_CONTROL', RL_INC . 'controllers' . RL_DS );
    define( 'RL_LIBS', RL_ROOT . 'libs' . RL_DS );
    define( 'RL_TMP', RL_ROOT . 'tmp' . RL_DS );
    define( 'RL_UPLOAD', RL_TMP . 'upload' . RL_DS );
    define( 'RL_FILES', RL_ROOT . 'files' . RL_DS );
    define( 'RL_PLUGINS', RL_ROOT . 'plugins' . RL_DS );
    define( 'RL_CACHE', RL_TMP . 'cache_xxxxxx' . RL_DS );

    // system URLs
    define( 'RL_URL_HOME', 'http://www.xxxx.com/' );
    define( 'RL_FILES_URL', RL_URL_HOME . 'files/' );
    define( 'RL_LIBS_URL', RL_URL_HOME . 'libs/' );
    define( 'RL_PLUGINS_URL', RL_URL_HOME . 'plugins/' );

  2. #2
    Hello Desmond Lim,

    Yes needs some changes here. Path to files will be different and you should write new.
    Let me know what a new location path for files from library?

    Please upload files on this service (CDN) and send me path for it. I want to check it.
    Viktor,
    Flynax technical department,
    Best wishes.

  3. #3
    Senior Member
    Join Date
    Dec 2011
    Posts
    159
    define( 'RL_URL_CND', 'http://cdn.xxxx.com/' );

    define( 'RL_LIBS_URL', RL_URL_CDN . 'libs/' );
    define( 'RL_PLUGINS_URL', RL_URL_CDN . 'plugins/' );


    define( 'RL_ROOT_CDN', 'http://cdn.xxxx.com/ . RL_DS . RL_DIR );

    define( 'RL_LIBS', RL_ROOT_CDN . 'libs' . RL_DS );
    define( 'RL_PLUGINS', RL_ROOT_CDN . 'plugins' . RL_DS );


    I will try on my side and implement if the above works, is it correct?

  4. #4
    Hello Desmond Lim,

    Would you please explain me what files do you want to move on CDN? Also RL_ROOT_CDN no needs because same url with RL_URL_CND.
    Viktor,
    Flynax technical department,
    Best wishes.

  5. #5
    Senior Member
    Join Date
    Dec 2011
    Posts
    159
    I want to the following folders insider lib to CDN

    - Javascript
    - Jquery
    - Ajax

    Also files from:

    - CSS

    I have not implement yet but following is a more critical problem that I am facing with the coupon. Coupon users are not updated in the coupon_user tables as a result the limited function is not working.

    Coupon that limit to 1 use and be used multiple times. Can you please help to solve this first. A ticket has been issued already.

    http://www.flynax.com/forum/showthre...=1405#post1405
    Last edited by rosegarden; June 5, 2012 at 02:51 AM.

  6. #6
    Hello Desmond Lim,

    It's ok but Ajax files we should leave on your server.
    Please upload css files on CDN and send me urls for it. I will try to connect this files in your site.
    Viktor,
    Flynax technical department,
    Best wishes.

  7. #7
    Senior Member
    Join Date
    Dec 2011
    Posts
    159
    I have raised a ticket ORC-146539: CDN of CSS and Img as I do not wish to place my CDN link here.

    I have set a CDN path for CSS and IMG (for that template) only

    However this CDN path is subject to changes as it is not fixed yet. If possible, i hope you can just want to rough guide so that I can make the changes if the path changes in the future.

    Each plugin has it own static CSS as well, is it possible to implement them as well.
    I have a total of 9 CSS that is downloaded each time because of the plugins other the main CSS.

  8. #8
    Senior Member
    Join Date
    Dec 2011
    Posts
    159
    Alternatively, assume we already know which plugin we are going to use , can we combine all the CSS for those plugins + main CSS together into one single CSS instead of so many stream of download each time?
    Last edited by rosegarden; June 7, 2012 at 04:42 AM.

  9. #9
    Senior Member
    Join Date
    Dec 2011
    Posts
    159
    I try to modify the header.tpl by including the following but it does not seem to work correctly, any advice on that?

    Basically what it does is it test whether the browser can accept gzipped and then send the gzipped version.

    Any other suggestions?

    ====
    file : header.tpl
    Purpose : CDN both js and css
    Sending gzipped version if supported

    ============



    <script type="text/javascript">var sr_gzipEnabled = false;</script>
    <script type="text/javascript" src="http://d2ft4b0ve1aur1.cloudfront.net/js-050/sr.gzipcheck.js.jgz"></script>

    <noscript>
    <link type="text/css" rel="stylesheet" href="http://xxxx.cloudfront.net/css/common.css">
    </noscript>
    <script type="text/javascript">
    (function () {
    var sr_css_file = 'http://xxxx.cloudfront.net/css/common.css';
    if (sr_gzipEnabled) {
    sr_css_file = 'http://xxxx.cloudfront.net/test/common.css.gz';
    }

    var head = document.getElementsByTagName("head")[0];
    if (head) {
    var scriptStyles = document.createElement("link");
    scriptStyles.rel = "stylesheet";
    scriptStyles.type = "text/css";
    scriptStyles.href = sr_css_file;
    head.appendChild(scriptStyles);
    //alert('adding css to header:'+sr_css_file);
    }
    }());
    </script>

  10. #10
    Hello Desmond Lim,

    can we combine all the CSS for those plugins + main CSS together into one single CSS instead of so many stream of download each time?
    Yes we can merge all css files in 1 file and upload on CDN server. about archived css file it's not important for now. Browser downloads the file only one time and then caches it.

    I check your ticket right now.
    Viktor,
    Flynax technical department,
    Best wishes.

+ Reply to Thread