Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Faster Page Loads


Recommended Posts

Has anyone installed the Faster Page Loads, Less DB queries contribution and gotten it to work?

 

Basically, this contribution reduces the amount of work the server does before sending the HTML page to the browser by writing a php file to a specified folder which contains the relevant config data. Therefore making pages load much quicker for customers.

 

I've followed the instructions as best as I can. After the first step (altering catalog/admin/configuration.php), you are required to edit an item in the store admin area which then creates the file automatically.

 

This doesn't seem to work for some reason. The file is not created.

 

The instructions say that the directory the php file is stored in should have write permissions. I've tried practically every combination of chmod to get this thing to work.

 

Theoretically installing this contribution should take no more than 5 mins as you only need to change 3 files and make one directory. If only it worked!

 

Has anyone gotten it to work, cos this contribution is driving me crazy.

 

Thanks in advance.

Link to comment
Share on other sites

  • Replies 154
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...

A new version of the contribution now named Configuration Cache can be found here.

 

The code has been updated for less overhead, accomodate for a missing file, and the install instructions are now html. :)

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

It seems to work, but I got a parse error when I go in my admin area (the blue front screen) and than try to go to the config area:

 

http://www.myserver.com/myadmin/configurat...iguration&gID=1

 

this causes a parse error

 

in line 32

 

31 if ( file_exists( $osCDBConfigFile)) unlink ($osCDBConfigFile);

32 $fp = fopen( $osCDBConfigFile , 'w') ;

33 $fout = fwrite( $fp , $output ) ;

 

I have 2.2 MS1

 

Everythig else seems to work also when I try only:

 

http://www.myserver.com/myadmin/configuration.php

 

this is also working. But I can't change the variables or can see them. It must be a mistake with the end "selected_box=configuration&gID=1".

 

No matter if configuration&gID=1 or configuration&gID=2 or configuration&gID=3 ....

Everitime parse error

 

HTH

 

Stefan

Edited by kooyan
Link to comment
Share on other sites

The oscDBConfiguration.php is created when you go into Admin ~ Configuration ~ My Store, click Edit and then click Update.

 

This will cause the file to be created.

 

What path is specified for the file?

 

This can be found in admin/includes/application_top.php around line 63 and should be on a line that starts off as "$osCDBConfigFile = "

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Stefan,

 

If you are using MS1, you need to edit a line in the admin\configuration.php file.

 

Set the line that defines $output in the where loop to be:

            $output .= 'define(' . $configuration['cfgKey'] . ',\'' . $configuration['cfgValue'] . '\');' . "\n";

and that should correct your problem.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

the code to write the file should also be placed in admin/modules.php under the installing, removing, & saving areas.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I had considered writing all of the configuraton information to a cache file but am still deciding on the feasibility of it.

 

Personally, I do not modify my configuration often. Mostly just working with orders and what not.

 

What is everyone else's experience, use, thoughts?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

I had considered writing all of the configuraton information to a cache file but am still deciding on the feasibility of it.

 

Personally, I do not modify my configuration often. Mostly just working with orders and what not.

 

What is everyone else's experience, use, thoughts?

well as this contribution is, it writes all of the configuration information to the cache file. It only updates the cache though on configuration.php and not modules.php (both of which modify the configuration in the database).

 

Personally I do not modify configuration or installed modules on our live store very often either. But on the local development install, I quite often do play around with both. I was a bit confused at 1st when I tried to install a new payment module and it did not take, but then realized the cache needed to be updated on the modules.php page as well.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

You make a very good point dreamscape. That is indeed a scenario that I had not considered, even with my own development.

 

I will update the contribution as you have suggested.

 

Have you found any other deficiencies other than re-writing the file in the modules section?

 

Thank you for your help. :)

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

The contribution has been updated to re-generate the cache file when the modules are modified as per dreamscapes suggestion.

 

Get the new file here.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Hello,

 

The 2nd line of the .sql file in v1.20 has

'tep_cfg_select_option(array(\'true\', \'false\'), ', now());

 

Is there a missing apostrophe in the 3rd element of the array?

 

Also, will this contribution work with even a heavily modded OSC? The install is fully reversable right? Also, the new version I see creates a new cache file when a module is updated...on what other circumstances would I have to update the cache file? I add/edit contributions quite a bit and also change the layout of the site quite a bit as well.

 

Thanks in advance.. I have heard a lot of good things about this contribution and hope to install it soon.

Link to comment
Share on other sites

Hello,

 

The 2nd line of the .sql file in v1.20 has

'tep_cfg_select_option(array(\'true\', \'false\'), ', now());

Is there a missing apostrophe in the 3rd element of the array?

No, that is taken care by osCommerce when that field is read.

 

Also, will this contribution work with even a heavily modded OSC? The install is fully reversible right?

Yes on both counts. :)

 

In fact, it works better on those because they have more records in the configuration table to be cached. :)

 

Also, the new version I see creates a new cache file when a module is updated...on what other circumstances would I have to update the cache file? I add/edit contributions quite a bit and also change the layout of the site quite a bit as well.

Anytime the configuration stored in your database changes, the cache file will need to be recreated.

 

This is already taken care of in the configuration and modules sections. If you modify your tax rates or any other settings outside of configuration or modules you will need to recreate the cache file. I am working on correcting this deficiency.

 

Lastly, if you modify your configuration outside of osCommerce (e.g. importing a .sql file from a contribution) you will need to recreate the cache file. There is nothing I can do within the contribution to accommodate this.

 

Thanks in advance. I have heard a lot of good things about this contribution and hope to install it soon.

You are welcome. :)

Edited by Daemonj

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Just installed V1.2 and want to tell you this thing is now working very well, since you add a field where to define the file for the config. Believe me, my distribution is really heavy modified (> 100 changes I don't count anymore).

 

It really helped. I realized the pages are now loading faster.

 

Thanks a lot.

 

Stefan Fritsche

www.klosterbrauerei.com

Link to comment
Share on other sites

I just found a fatal flaw in v1.10 through v1.20 of this contribution and modified the code accordingly. Everything prior to v1.20 is not affected

 

If you have a previous version installed, I highly recommend downloading the new version (v1.30) and updating your installation.

 

Upgraders note: Read the instructions carefully as minor changes were made that have a significant impact. In other words - don't gloss over the steps. ;)

Edited by Daemonj

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

I have just installed this contrib and I noticed an immediate improvement in the loading time of my pages.

the only thing that I found unclear was where is the cache file created?

I sepecified in both configuration_cache_read.php files:

$config_cache_file = '/config_cache/temp.txt';

so where is this file created?

as you can tell I haven't really grasped the whole idea behind caching...

thanks again for the contrib, and I would love an explanation...

-Amitai

Link to comment
Share on other sites

I sepecified in both configuration_cache_read.php files:

$config_cache_file = '/config_cache/temp.txt';

so where is this file created?

That would place a file named temp.txt in the /config_cache folder, at the root of your server.

 

The best thing to do is find out your home directory (ask your host if you are unsure).

 

Then use an ftp client without specifying a remote directory and you should be in your home directory Create a folder (e.g. cache) to store the cache file and gove it 777 permissions.

 

So if your home directory is /usr/home/fred, you would enter /usr/home/fred/cache/config_cache.php as the $config_cache_file in both of the configuration_cache_read.php files.

 

Does that help?

Edited by Daemonj

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

This contrib will not affect the speed of your thumbnail creation but it will speed up your site in general.

 

Is that what you were looking for?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Seems both .html-files (config_cache_install) in v1.30 are for ms2...  :(

The information is correct but I forgot to change the lables and link in the file.

 

Can you tell which file I used as a template? :D LOL

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

This contrib will not affect the speed of your thumbnail creation but it will speed up your site in general.

 

Is that what you were looking for?

Hi

 

Thanks. I will install this contrib to see how it performs. ;)

 

Regards

Link to comment
Share on other sites

I sepecified in both configuration_cache_read.php files:

$config_cache_file = '/config_cache/temp.txt';

so where is this file created?

That would place a file named temp.txt in the /config_cache folder, at the root of your server.

 

The best thing to do is find out your home directory (ask your host if you are unsure).

 

Then use an ftp client without specifying a remote directory and you should be in your home directory Create a folder (e.g. cache) to store the cache file and gove it 777 permissions.

 

So if your home directory is /usr/home/fred, you would enter /usr/home/fred/cache/config_cache.php as the $config_cache_file in both of the configuration_cache_read.php files.

 

Does that help?

Hi,

How about using windows as server? How would the directory be? I intend to put in the following directory:

 

C:\Program Files\Apache Group\Apache2\htdocs \config_cache_gift\configuration_cache.php

 

Also the filename configuration_cache.php is generated automatically or I have to create a file with empty content. Please advise.

 

Can this file configuration_cache.php be some other filename abc.php or abc.txt? It is quite confusing as there is a file configuration_cache.php in the admin\includes directory.

 

Thank you. :rolleyes:

 

Regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...