Advertisement:

Author Topic: Osclass Memory Usage and Caching  (Read 12899 times)

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Osclass Memory Usage
« Reply #30 on: May 13, 2015, 01:45:00 am »
Hehe well the memory performance discussion was kinda down to what could be done, what is interesting and what is already in place so I gave that one a rest since I think we all agree there and I do think it would be nice to see some performance monitor plugin not having to switch to cpanel.  8)

Dynamic/static, I know harmony bwteen the two is okay, I just thought about caching and where to start so I started about the system setup in general and moved towards the plugin with regard to the 'static' pages. Since performance, especially on cheaper hosts, can be tuned pretty well to see a nice performance gain which is partly due to the system and browser caching tweaks through htaccess or straight on the box itself.

The WP plugins, I have read about one plugin for Wordpress which seemed to be very popular. I thought maybe you had chosen it as a reference when working on your own cache plugin. :)

The minifying plugin from Osclass I used once and it did break stuff so I decided to forget about this plugin and just focus on keeping files minified and as little different files as possible. I simply use an online minifier for both css and js.

Thinking about what you said, I am trying to understand the cache mechanism for static pages in a plugin. Isn't it simply a matter of having a routine that creates the static pages and store them in a seperate folder orso and let Osclass check to see if the specific page is available to retreive it from folder or have it created dynamically and created as static?


We are away from the original topic and nobody here have any mod privileges to split it into 3 directions it is headed, now becoming a real mess :)

@ SmaRTeY
In your first part of the post you touched several things that are all different, not sure what you are pointing to? In any case, dynamic caching does not mutually exclude static caching, they can both work and live in harmony.

As for the last question, WordPress has many plugins of this kind, some are very complex because they offer additional features (not only caching) and they are of different architecture from Osclass (as you already know that). Not sure which one do you have in mind? I have only briefly tested few. Many WP plugins offer js/html/css minify+combining as extra features, which I don't like at all inside Osclass. Why? There are sensitive plugins and theme parts that break every time with any minifying script tested out there.

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Osclass Memory Usage
« Reply #31 on: May 13, 2015, 01:48:28 am »
I like this idea of letting Admin select pages to be cached....

I have not decided yet how to proceed with main page, because of many different themes out there (it's becoming a real jungle).

Main page ! Ok, how about let the webmaster to select if he wants to be cached or not. Or refresh the main page when some recent ad is edited or deleted. It is so very SAME with the LOGIC that Wordpress caching works. Maybe the internal is different but the logic is 100% the same. The Blog Posts are for Osclass the Item ads.

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Osclass Memory Usage
« Reply #32 on: May 13, 2015, 01:53:49 am »
The thought of creating a cache plugin for Osclass is tempting but would take time figuring out first what best practice would be. I'd probably want to analyse cartagena68's plugin first and hear what your WP cache plugin knowledge is about  8)

I really like the thought of being able to gain more control over what pages to cache through Admin and page selection.




Is your plugin comparable with the Wordpress cache plugin Dev101?

I have no idea what dev101 plugin is but i do know inside-out all the Wordpress plugins. And they are very mature. If you need help, just pm me.

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Osclass Memory Usage
« Reply #33 on: May 13, 2015, 03:02:29 am »
Main page ! Ok, how about let the webmaster to select if he wants to be cached or not. Or refresh the main page when some recent ad is edited or deleted. It is so very SAME with the LOGIC that Wordpress caching works. Maybe the internal is different but the logic is 100% the same. The Blog Posts are for Osclass the Item ads.
No, that optional part is easy :) Of course, it already exists in plugincache by cartagena, I was talking about some other dynamic stuff that is going on there. I already figured gallery/list view and that is not a problem at all. The issues are other things... potential plugins, 3rd party themes with custom options that I am not aware of yet, it is hard to take all of that into account and make it work for all themes universally without bloating it for the sake of compatibility.

Aficionado

  • Guest
Re: Osclass Memory Usage
« Reply #34 on: May 13, 2015, 03:02:46 am »

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Osclass Memory Usage
« Reply #35 on: May 13, 2015, 03:04:32 am »
That looks like a fork from cartagena's version, but the files are missing. Probably got merged, cannot remember really, was long time ago.

That description part was done by me when Jay created the repo and set me as an owner ( ;D ) later added cartagena as well.

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1198
Re: Osclass Memory Usage
« Reply #36 on: May 13, 2015, 03:06:10 am »
Yes, is the same plugin.

Aficionado

  • Guest
Re: Osclass Memory Usage
« Reply #37 on: May 13, 2015, 03:15:25 am »
The issues are other things... potential plugins, 3rd party themes with custom options that I am not aware of yet, it is hard to take all of that into account and make it work for all themes universally without bloating it for the sake of compatibility.

I'm not a programmer, so i would like to ask why plugins can break the caching of the Items (ad) page ? I mean, why for example a bookmarking plugin can break the caching plugin ?


dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Osclass Memory Usage
« Reply #38 on: May 13, 2015, 03:21:34 am »
Bookmarking - you mean social widgets? No, that is not going to be affected at all.
But I don't know by heart every plugin (neither tested all 200+ of them) and don't wish to do wild guessing before any testing.

For example, Admin Tools Login plugin is particularly tricky one, it took me some time to figure it out and make it work along without issues and compromising security.
« Last Edit: May 13, 2015, 03:23:49 am by dev101 »

Aficionado

  • Guest
Re: Osclass Memory Usage
« Reply #39 on: May 13, 2015, 03:28:31 am »


For example, Admin Tools Login plugin is particularly tricky one, it took me some time to figure it out and make it work along without issues and compromising security.

But caching is for non logged users, right ?

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Osclass Memory Usage
« Reply #40 on: May 13, 2015, 03:32:03 am »
Oh, yes, yes it is :D

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
Re: Osclass Memory Usage and Caching
« Reply #41 on: May 13, 2015, 10:56:46 am »
By loading classes on a need to load basis, the overall performance is increased since the only file reads that occur are for the files needed. This technique is called lazy initialization.

Osclass can be reduced from 12-18 mb/page to 5-6 mb and faster response time .

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Osclass Memory Usage and Caching
« Reply #42 on: May 14, 2015, 01:49:49 am »
Yes, I thought about this long time ago, was wondering how this is setup in Osclass since my php and webdev is new to me. I always used the JIT loading of classes with the exception of maybe a session kinda class carrying little information yet important throughout the use of the application that is holding for example the most important id's preventing extra DB calls throughout page uses. For this reason I am using vars in pages where I think it will prevent extra DB calls looking at the class calls. But again I have no idea how php engine is managing this, for all I know php could manage this self meaning no need to give this extra attention.

What you mention is mostly done already with the javascripts using the enqueue function but I was wondering about the classes, are they really used as memory hogs in current Osclass architecture? If so that should definitely be changed for reasons you mentioned!


By loading classes on a need to load basis, the overall performance is increased since the only file reads that occur are for the files needed. This technique is called lazy initialization.

Osclass can be reduced from 12-18 mb/page to 5-6 mb and faster response time .

Aficionado

  • Guest
Re: Osclass Memory Usage
« Reply #43 on: May 14, 2015, 03:36:59 am »
Oh, yes, yes it is :D

hmmm.

Could a multi-country setup with countries as subdomains (wild card dns) be a problem ?

 ???

Web-Media

  • Sr. Member
  • ****
  • Posts: 453
  • Web
Re: Osclass Memory Usage and Caching
« Reply #44 on: May 14, 2015, 10:22:23 am »
 A smart  class loader will do the job .  Osclass loads all classes at beginning  ,but not all classes are required everywhere.
Example 1(simple): we can have 2 oc-load files. 1 for front-end(with classes neesed in front) 2 for admin (actual oc-load).
Example 2 : load few basic classes at beginning , and class loader will load needed classes per controller.