Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Frank Goossens

    (@futtta)

    the “Also aggregate inline JS” does not catch up all inline Scripts.

    this might well be intentional;
    1. AO by and of itself excludes specific strings from optimization to avoid issues (e.g. excluding “nonce” to avoid nonce’s busting the cache or excluding Google Analytics and WordPress stats to avoid them breaking)
    2. plugins can themselves ensure they’re excluded (using the AO API).

    hope this clarifies,
    frank

    Thread Starter bffnb

    (@bffnb)

    Hi,

    the following code is kind of the one that are not catched:

    <script>var block_td_uid_2_571bf6cb049bb = new tdBlock();
    block_td_uid_2_571bf6cb049bb.id = "td_uid_2_571bf6cb049bb";
    block_td_uid_2_571bf6cb049bb.atts = '{"..."}';
    block_td_uid_2_571bf6cb049bb.td_column_number = "1";
    block_td_uid_2_571bf6cb049bb.block_type = "td_block_2";
    block_td_uid_2_571bf6cb049bb.post_count = "6";
    block_td_uid_2_571bf6cb049bb.found_posts = "29";
    block_td_uid_2_571bf6cb049bb.header_color = "";
    block_td_uid_2_571bf6cb049bb.ajax_pagination_infinite_stop = "";
    block_td_uid_2_571bf6cb049bb.max_num_pages = "5";
    tdBlocksArray.push(block_td_uid_2_571bf6cb049bb);
    </script>
    Plugin Author Frank Goossens

    (@futtta)

    given the randomness of the uid, I think it’s a good idea not to aggregate that (as it would bust the JS cache).

    frank

    Thread Starter bffnb

    (@bffnb)

    I understand, but it would be awesome if there is way to cache also scripts with random numbers and remove them afterwads from the cache if a new script is generated – but i think thats not possible with the random uid number…

    if there is no way – you can close this topic.
    Thank you so much
    best

    Plugin Author Frank Goossens

    (@futtta)

    that would prove too complex difficult, not in the least because ideally your autoptimized JS is used by multiple pages, where the uid will likely always be different. so removing an autoptimized JS from cache because the UID changed could effectively removed JS with UID still in use on another page 🙂

    frank

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Aggregate inline JS – not catch up all inline scripts’ is closed to new replies.