osCommerce: Cache

Setting your cache in osCommerce. The documentation.pdf states the following:

Whenever your cache directory is not setup for your store you will get a pink error
message at the top of the store screen like this:

Error: Cache directory does not exist. Please set this Configuration->Cache.

Personally, I didn’t set my cache up properly yet. I also didn’t receive the above error since my Configuration/Cache was set to false by default.

Defaults of the osCommerce Cache

Default Cache Configuration in osCommerce

Default Cache Configuration in osCommerce

In the admin under Tools/Cache Control the listings are as follows:

osCommerce Cache Control Settings

osCommerce Cache Control Settings

The default for the Cache Directory is /tmp/

The osCommerce documentation advises to create a sub-folder named “cache” in the main folder (catalog). Using Ipswitch click on the New Folder button.

Create Cache Sub-folder using Ipswitch FTP

Create Cache Sub-folder using Ipswitch FTP

Right-click on the cache sub-folder and then click Properties.

Right-click Cache Sub-folder and then click Properties

Right-click Cache Sub-folder and then click Properties

Make Cache Directory

Make Cache Directory

Set chmod permissions to 777.

Chmod Permissions 777: osCommerce

Chmod Permissions 777: osCommerce

Then go to Configuration/Cache. Click on “Use
Cache” and set to “true”.

osCommerce: Use Cache set to true

osCommerce: Use Cache set to true

osCommerce: click the Update button in Cache Settings

osCommerce: click the Update button in Cache Settings

Click on Cache Directory and set the absolute directory path to the “cache” folder

Click the edit button once you click and highlight the Cache Directory.

osCommerce: change Cache Directory

osCommerce: change Cache Directory

You need to enter your absolute path (as opposed to the relative path. So go to Tools. The Database Backup Manager should display. You’ll see the Backup Directory. So for me the absolute path looks something like:

[absolute path to]/public_html/ultratrust/asset-protection-book/cache/

if you use linux the absolute path to the cache directory may be something like /home/username/public_html/domainname/catalog/cache/

Click the update button.

The osCommerce documentation warns to remember about case sensitivity so I just simply copy and paste the absolute path from the Tools/Database Back Manager.

osCommerce: Database Backup Manager

osCommerce: Database Backup Manager

file does not exist error: osCommerce cache

If the “file does not exist” messages still exist, upload via FTP, three blank files into your cache directory called:
categories_box-english.cache
manufacturers_box-english.cache
also_purchased-english.cache

osCommerce: Tools/Cache Control

osCommerce: Tools/Cache Control

Once you create those files and upload them you’ll see the following. Just remember to create the filenames as above and do not place any text within the files.

osCommerce: Tools Cache Control Refreshed

osCommerce: Tools Cache Control Refreshed

The osCommerce docs state:
If there are more languages, create more files replacing engish with language name and upload.

For example,
categories_box-spanish.cache
manufacturers_box-spanish.cache
also_purchased-spanish.cache

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Share

You must be logged in to post a comment.