By Josh Lewis on Sunday, 19 February 2017
Posted in Technical Issues
Replies 7
Likes 0
Views 247
Votes 0
When publishing a frontend Joomla article, the ES content plugin generates a stream item. The issue is that the stream item generated contains the entire article HTML itself (encoded of course). Attached to this post is an example of a single stream item from #_social_stream that has a size of 155 Kilobytes. If users generate thousands of articles it's going to take up a lot of space fast. I understand that users will write smaller articles most of the time, however it would be ideal to save hundreds/thousands of megabytes of DB space. One of two methods could solve this for future article stream items:

1. Rather than caching the entire article text, simply cache the display character limit (default is 300 characters). Stream items would continue to display exactly as they do without using a ton of space.

2. Render the text from the article itself. Kunena stream items seem to do this as seen here: https://dev.peakfun.com/stream/item/103

For the sake of investigating here's a link to the big stream item: https://dev.peakfun.com/stream/item/102
EasySocial caches the contents on the database to reduce the number of SQL queries that are fired when your stream is loaded. This includes storing the contents of the article in the table.

What you are proposing is not really viable. Why?

1. You are under the assumption that the site will always only use 300 characters. When the admin decides to change the settings to 600 characters, it will break.

2. Because the data of the article is also stored on the stream, the category object is also cached.

3. By removing the article data from the stream. For each stream items generated from an article, it generates 2 additional SQL query.
·
Sunday, 19 February 2017 20:33
·
0 Likes
·
0 Votes
·
0 Comments
·
EasySocial caches the contents on the database to reduce the number of SQL queries that are fired when your stream is loaded. This includes storing the contents of the article in the table.


I agree with storing text from the article for the sake of reducing SQL queries. It's a matter of how much it stores that I want to discuss. I was intrigued by how Kunena stream items worked and mentioned it as a possible method (obviously it looks like a bad idea now). Hopefully they too someday store part of the post text to reduce SQL queries.

You are under the assumption that the site will always only use 300 characters. When the admin decides to change the settings to 600 characters, it will break.


I was proposing that it be dynamic in the sense that the number of characters it stores be exactly the same as the admin setting known as "Maximum Content Length". So if the admin changes it from 250 to 500, future stream items could store 500 characters of article text. Stream items with far less than the maximum content length seem to display just fine. Theoretically this means old stream items would render as they should.
·
Monday, 20 February 2017 06:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for your input Josh.
·
Monday, 20 February 2017 19:09
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post