Jump to content


Photo
- - - - -

Less Compiled CSS Cache-control


  • Please log in to reply
11 replies to this topic

#1 thorstone137

thorstone137

    Advanced Member

  • Members
  • 62 posts
  • Framework Version:2.3

Posted 22 June 2012 - 07:49 PM

Hello, Is there a way to set the cache-control for pagelines-compiled-css-$? Thanks!

#2 beardedavenger

beardedavenger

    Unicorn Wrangler

  • Members

  • 1219 posts
  • Country: Country Flag

Posted 22 June 2012 - 08:58 PM

Hey There, Can you be a bit more specific as to what you're trying to do? Nick

#3 thorstone137

thorstone137

    Advanced Member

  • Members
  • 62 posts
  • Framework Version:2.3

Posted 25 June 2012 - 04:48 AM

Does pagelines 2.2 compile and cache less css? Yes or no? If it does, does it get cached? If it does, does get cached server side? Can I control how long? Can it be cached externally? Can i cintrol how long? Best regards, Dustin

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 25 June 2012 - 04:01 PM

I don't believe specific files are cached uniquely. Caching usually handles the entire volume of the site. CDN may handle select types of files. Whatever caching system you use should have controls for duration of the caching, and the type of caching used determines if it's local or external.

#5 jordi

jordi

    Member

  • Members

  • 12 posts
  • LocationCardedeu, Barcelona
  • Country: Country Flag

Posted 15 July 2012 - 07:45 AM

Changes made to style.less in the root child theme folder are not being applied inmediately. I removed the file from the server and the css styles where still being applied. There should be a way to clear that cache manually.

#6 jordi

jordi

    Member

  • Members

  • 12 posts
  • LocationCardedeu, Barcelona
  • Country: Country Flag

Posted 15 July 2012 - 07:53 AM

Ok, Saving Pagelines Options does the trick...

#7 Danny

Danny

    Is Awesome!

  • Moderators
  • 16952 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 15 July 2012 - 12:37 PM

Hi Jordi, Is your issue now resolved ?

#8 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 15 July 2012 - 02:38 PM

The compiled LESS css is stored using the Transients API. These are like wordpress options except they expire after a defined period of time. The default expiration time for compiled less is 24 hours (developers please see below).

So either the transient times out and then the less is recompiled on the next page load, or you can flush this cache.

On the pagelines Theming page, it says this:

Tip:Disable the LESS caching system while working locally. Simpy add

 define('PL_LESS_DEV',true);
to your wp-config file, and this will turn off the caching system. DO NOT use this on a production rig, or you'll face a nuclear melt-down. You have been warned!


This is not 100% accurate (not just about the nuclear melt-down part). The constant does not disable the caching system (at this point at least, perhaps things are in the works to be consistent with this statement in the future) but at current, it forces the LESS to be recompiled on every admin (backend) page load. So if this is set, all you have to do is reload/navigate to any admin page, (or if you just saved your options, that would work too) and that will recompile your LESS.

It's worth noting, that if you get a parse error in your LESS when it's compiled that your site will serve up a backup version of your last good compiled less. If you have a parse error it will let you know with a big red button in your wp admin bar, though so it's obvious. Basically, if you have a parse error, you won't see your most recent changes even if you're forcing a recompiling of the less.

@danny, @beardedavenger -
About the problem I referenced above, please let the developers know that there is a typo in the __construct function of the PageLinesRenderCSS class defined in class.render.css.php
 $this->ctimout = 86400;
where the set_transient functions use
 $this->ctimeout

Thanks!

#9 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 15 July 2012 - 06:20 PM

Thx for the heads up on the typo, and the explanations :) The PL_LESS_DEV does indeed flush the cache on every pageload, frontend and backend!

#10 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 15 July 2012 - 06:36 PM

@pross - I stand corrected! I don't know how I missed the frontend call :/ I'm just curious - wouldn't a typo like that throw a php notice or something when the set_transient function is referencing a property that isn't set/defined in the class? Thanks!

#11 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 15 July 2012 - 06:59 PM

No, because it was already declared as a var at the top of the class. ;)

#12 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 15 July 2012 - 08:16 PM

@pross - ah yes :) So the ctimeout property would have been evaluated as 'null' and the function was using the default of 0 for the timeout? Thanks for your comments!