Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Q2A Core by
edited by

Avatar images are loading from the db in the form of data blobs, not files. e.g.


and that slows down my website loading dramatically. even fetching small jpg files from db takes over 2 seconds!  

Any suggestions ?

Updated(March 12):
QA cache used MemCached ( earlier I used filesystem cuz memcached was not avaialbe, now I am ussing MemCached to make the screenshots below)

Q1: yes I was but disabled the clud flare and generated the following result

Q1&2: Both Could flare and QA cache disabled

Q1&2:Cloudflare: disabled QA: remain enabled

Q1&2: Cloudflare: disabled QA: disabled 

Q3: refer above please
Q4:pressing favorite star Cloudflare: disabled QA: disabled 

Q4:pressing favorite star Cloudflare: disabled QA: enabled ( repeated multiple times)

Q2A version: 1.85
This could be a server/hosting issue. The information is considerably incomplete to get to any conclusion. Some additional information will be helpful:

1. Do you have caching enabled?
2. If you have Q2A caching enabled, disable it, retest and provide the results (fetch the same page)
3. I noticed rocket-loader.min.js. If you have some caching enabled in cloudflare or your hosting provider, disable it, retest and provide the results (fetch the same page)
4. Navigate to a question page, open the Chrome inspector in the network tab and click on the favorite star of the page. Then provide a screenshot of the inspector
The question has been updated with a new screenshot.
I just did not get the part about favorite star.
Seems to me data blobs don't get cached
I'm still missing an answer to questions 2 and 4.

Clarification on 2: I want to see if the Q2A cache is making the results faster or slower. As you've changed both caches, I can't tell. Disable cloudfare and leave the Q2A cache (which I guess it is the Filesystem one) and provide an additional screenshot

Clarification on 4: I just want to see how long it takes to favorite/unfavorite a question. Those are the steps to follow
Generated new screenshots and inserted into the post. Thank you
OK, we can confirm Q2A's cache is irrelevant, from the images. However, it makes sense, as the images are not really using what you configure in admin/caching (I actually thought they were).

1. How many records does the ^cache table have?

2. Edit file qa-include/qa-image.php and comment these lines:
$content = qa_db_cache_get($cachetype, $blobid);
... and also ...
if (array_search($size, $cachesizes))
    qa_db_cache_set($cachetype, $blobid, $content);

Once you have done this run the tests with cloudflare and QA cache disabled (in order to keep tests as similar as possible).

When running the tests, make sure to check the "Disable cache" checkbox in the Network tab of the Chrome inspector

3. Have you changed the default value of QA_DB_MAX_CACHE_AGE (which is 86400)?

4. If you try to access the URL of a single file, for example, the URL with the blobid 7639... at the bottom of the last image, how much does it take? Make sure it is the same URL (exactly, with the same size). Make 2 tests here: test with the original code and also with the change I suggested in item 2.

Please log in or register to answer this question.