Is there anything within the modx framework allowing you to save data for the duration of the user's session?
(i know I can use $modx->savevalue for the duration of 1 request)
Reason I am asking is - I am using the "supercache" plugin. Works great and cuts down load times to around 0.1s per page. However doesnt work so great with sessions.
Is there anything else I could use instead of $_SESSION?
Supercache plugin has managed to speed up my front end pages significantly, with some jiggery pokery they are doing with modx cache.
Basically my homepage used to load in ~1.5s
With supercache enabled it now loads in ~ 0.09s
Not only that, but for instance I have an uncached dynamic page, which used to load in around 1-2 secs. Its basically a dynamic page showing content from a custom database, based on the URL. I tested this page with supercache - i was expecting it to take one snapshot and show the same content every time, however, instead it seems to work perfectly, showing correct content each time and still giving me the significant speedup when serving pages (~0.5s) as it appears to serve them from the cache.
Sessions are a problem, as it seems to remember only the first state of the session and hence creates a slight problem with some functionality issues.
I am looking to overcome this by using something other than session, so was wondering if anything like this exists...
I can pm u urls so you can have a looksie if u want
-
MODX Staff
- 10,725 Posts
It sounds like using SuperCache does not allow dynamic content, since it all gets cached. You might want to direct this to the attention of the author of that extra.
You are correct, it caches everything.
However, this is a plugin which has SIGNIFICANTLY reduced page load times for me. When I tested it first time I couldnt believe the speedup.
It still seems to work with some dynamic stuff as I mentioned.
Clearing the cache recreates all the cache files which happens on every page save, so if you change something it should be recreated.
Perhaps it would be wise for modx team to look into this plugin, maybe some concepts can be applied directly in modx? just an idea.
-
MODX Staff
- 10,725 Posts
It's faster, I assume, because it is just returning the page out of the cache, and thus is bypassing MODX entirely. I don't believe there is anything we could do in core to adopt that, other than deleting all of it and going back to making static HTML sites.
lol.
I understand.
I was just fantasizing about a system which does all pre-processing, and creates static files which it serves, until something is changed within modx...
Static HTML sites? slowly draws his gun towards his temple...