Sunday 15 September 2013

caching - CakePHP performance issues - cached view file size -


I have seen the size of the cached view file is very large (10-60 MB) page on KPPHP site (2.3.1) . Usually with sites, I expect caching to store pure HTML output but adding the serialized PHP at the top of the cake files. The size of this large file from the display perspective is problematic, the location of gigabytes (we use 1000s of pages), and apc is not suitable for caching (default maximum file size of 1 mb).

This is an example block on top of the cached view file:

   helpers = $ this- & gt; Helpers = Unassign (base64_decode ('& lt; deleted & gt;')); $ Controller- & gt; Layout = $ this- & gt; Layout = 'default'; $ Controller-> theme = $ this- & gt; Theme = ''; $ Controller- & gt; Visualwares = unasserial (base 64_decode (' gt;')); Router :: setRequestInfo ($ controller- & gt; request); $ This- & gt; Request = $ request; $ This - & gt; View = $ controller- & gt; Viewers; $ This- & gt; LoadHelpers (); Remove ($ this- & gt; View Vars, EXTR_SKIP); ? & Gt;   

I did not want any PHP there, because the HTML given below has given stable generating output.

  cache :: configuration ('default', array ('engine' =), & gt; 'apc');   

My only choice is to improve the file size of the visual cache files.

Any tips to solve the issue of the file size will be great.

I was able to greatly reduce the size of the cached view files by creating these two changes It is useful for someone who runs on such issue.

1 - model

There were many relationships between models, but I only really use the data on one side of the relationship. For example, there were images in one article, but I also had a relation to getting an article related to an image, which I have never used. To make relations 'on one side' requires cuts on heavy questions.

2 - Controller

In my PageNet array, I have recurring '= & gt; 2, which generated hundreds of additional questions per page. I chose this option as 'recursive' = & gt; 1 to cut the inquiry from 900 to 20 on a heavy page. There were about 6 people about many relationships on the model in question. This recurring level would have been unknowingly slipped into some stage.

I still think that KHHP is awkward to serialize php in cached visual files. A more optimal approach would be static HTML files without any PHP.

No comments:

Post a Comment