How do you speed up your page load time ?
That's a tough question. I do things way differently than many of the others in the MODx and web community. Most of load time is not serving... its parsing and querying. I keep my queries super tight by having a different resource structure then most others. I make sure I'm never getting information I don't need. I also make sure I don't have an "all-purpose" template with a ton of Output Modifiers. This means I always have the content I want.
Additionally, My JavaScript is very small. I use it for small, targeted AJAX requests and that is pretty much it. For my AJAX, I never request a full page. I only request Partial HTML, again meaning I only get the information I need. (AJAX is a great way to reduce load)
A lot of load is actually HTML structure, and I keep mine as simple as possible using semantic HTML, avoiding tables completely (if they aren't semantic), I avoid useless divs and containers. When I'm designing I use as few graphics as possible and add them later.
My CSS is small and written like an object-oriented program. I reuse as many classes as I can to avoid making extra styles. I also only use ids when it represents a unique element. This keeps my CSS small.
My Snippets fail silently
as soon as possible (early exit), limiting execution. This means that if I know early that I'm not getting information, I return .
Right now my page load is high as my cache is changing nonstop as I near public release. My Home Page alone accesses (and includes) over 800 Resources (my CSS is 650 Resources right now) at this point and I get them all in 3.5 seconds (which is fast considering the amount of data I'm handling. My way is not for everyone and is particularly refined for my needs. The above rules make a
huge difference in mitigating that load though. When I'm done developing and able to flatten my CSS to a single file again, my load will be negligible.
If I put a link to (myfolder/mycss.css), it is loaded in 100ms
This is effectively the same as what I told you in the first suggestion. The first suggestion was to simply stick the file in your assets folder. Its a flat file, not a Resource. It's a straight link with a URL http.://domain.tld/assets/mycss.css.
If I do a static resource on myfolder/mycss.css, and put modx tags in it, and then put a link to myfolder/mycss.css in a webpage, I receive a file with unmodified modx tags ...
It must have a template, not be 0 (empty). CSS may have a Template; Any Resource must have a Template with at least a [[*content]] in it be parsed. I'm reasonably sure that this applies to Static Resources, as well. My CSS is not Static, and it uses a Template and MODx tags.
I guess what I want to do is not possible, is it ?
(css modx document) ->(onsave) put results in myfolder/mycss.css
As said previously, you will have to write a Plugin for that. Probably on the OnDocFormSave, I'm guessing would be the best event to capture. Are you unfamiliar with MODx Plugins? If so, you can read about them
here