Support » Plugin: Autoptimize criticalcss.com power-up » One CCSS per page or page type ?

  • Hi there,

    I may miss something, but CCSS creation uses the criticalcss.com API to fetch back the CCSS of a _given page_. But, by default, _one CCSS_ is generated for every type (is_single for instance).

    So how is that possible ?
    The inlined CCSS for a given type is a sort of sum of every calculated CCSS for that type ?

    Please clarify.

    F.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    yes and no; for all but is_page (e.g. is_single or is_archive) the CCSS is assumed to be the same for all instances of said type so generated CCSS for one blogpost will be applied to all blogposts and based on our experience this is almost always the correct way.

    this is not the case for is_page as generally pages is where pagebuilder-creativity is unleashed so having one page dictate what CCSS is used on all pages does not work, so all pages by default will get their own path-based rule.

    if needed the same logic (switching from conditional to path-based) can be extended to other types with a couple of lines hooking into the API, let me know if you’d like an example of that 🙂

    Thread Starter fouedex

    (@fouedex)

    Many thanks.

    Under the item “Conditional Tags, Custom Post Types and Page Templates Rules” if I edit the file in the column “Critical CSS File”, which actual page CCSS I am editing ?

    Is there a way to know the number and list of pages for each standard and path based rule ?

    I sure want an example of how to use path logic to CPT with no extra work 😉

    F.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Under the item “Conditional Tags, Custom Post Types and Page Templates Rules” if I edit the file in the column “Critical CSS File”, which actual page CCSS I am editing ?

    the one of the conditional tag you’re editing, not one of a specific page.

    Is there a way to know the number and list of pages for each standard and path based rule ?

    no, don’t think so. might be do-able with some WP_Query I guess.

    I sure want an example of how to use path logic to CPT with no extra work

    Create rule -> conditional -> open drop down with conditionals -> your CPT’s should show in that list 🙂

    Thread Starter fouedex

    (@fouedex)

    So the CCSS of a given post of type is_page is not directly editable ?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, is_page is the exception, as pages get path-based rules that map to the exact path listed.

    Thread Starter fouedex

    (@fouedex)

    Hi && thanks for the good help 😉

    I still don’t see Toolset types in the Conditional Type Rule, even in latest beta.
    Maybe a creation type configuration.

    Path based rules don’t match my type slug neither.
    /agency/ or agency/ are still interpreted as is_single.

    I wish I could have 1 CCSS by page, which is the case, and one per type, which I can’t achieve. Maybe a PHP way : is that what you meant above ?

    if needed the same logic (switching from conditional to path-based) can be extended to other types with a couple of lines hooking into the API, let me know if you’d like an example of that 🙂

    F.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    re. toolset; the other thread 🙂

    re. “Path based rules don’t match my type slug neither”: but did you enter critical CSS in the rule, or is it waiting to be processed?

    re. “I wish I could have 1 CCSS by page, which is the case, and one per type, which I can’t achieve.”; what to you mean with one per type? because manual rules notwithstanding, that is exactly what should happen; blogposts are not served by individual rules, but by is_single, archives by is_archive, search by is_search, …

    Thread Starter fouedex

    (@fouedex)

    re. “Path based rules don’t match my type slug neither”: but did you enter critical CSS in the rule, or is it waiting to be processed?

    Waiting to be processed “To be fetched from criticalcss.com in the next queue run…”. In the process queue is is_single instead of my path rule.

    “I wish I could have 1 CCSS by page, which is the case, and one per type, which I can’t achieve.”; what to you mean with one per type? because manual rules notwithstanding, that is exactly what should happen; blogposts are not served by individual rules, but by is_single, archives by is_archive, search by is_search, …

    I want one CCSS per Custom post Types (Toolset ones), but can’t see the in the drop down (investigating this), and can’t path rules match.

    Thanks 🙂

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Waiting to be processed “To be fetched from criticalcss.com in the next queue run…”. In the process queue is is_single instead of my path rule.

    try adding critical CSS in the rule instead of leaving it empty. empty path-based rules eventually will get processed, but it can take a long time because a lot of conditions have to be met for it to be added to the job queue (it’s just an empty rule now).

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘One CCSS per page or page type ?’ is closed to new replies.