Solved

How to use Apache server .htaccess file to enable caching on shared hosting?

Posted on 2007-11-18
3
663 Views
Last Modified: 2010-08-05
I have some sites on shared hosting (GoDaddy) and I want to enable caching for the images and specific files that have been used on the site.

I don't know if there is a way to see what the main configuration settings are in the httpd.conf file, so I can check on what settings i can override with the .htacess file.  I want to be able to check the main config settings, is there a way to check those settings using PHP?

More importantly, any advice on how to enable caching of specific files using an .htaccess file is much appreaciated.  I've searched the net and it's tough to find any info on caching using .htaccess.

It's really tough to work with these files on shared hosting.  Any help is much appreciated.
0
Comment
Question by:parlays
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
John Mc Hale earned 500 total points
ID: 20328552
Maybe i'm wrong, but in order to enable caching, you have to use LoadModule to load mod_cache, and either mod_disk_cache or mod_mem_cache or both. Since LoadModule is a server config directive, it can only be used in a server configuration context. Thus, unless you can have your shared hosting service provider to configure the web server to enable caching, I think that you are not going to be able to achieve this.
0
 

Author Comment

by:parlays
ID: 20329363
This is quite unfortunate.  But let's say that caching is enabled on in the main configuration file.  Would I then be able to specify specific files with the .htaccess file?
0
 
LVL 13

Assisted Solution

by:John Mc Hale
John Mc Hale earned 500 total points
ID: 20329687
I don't believe so. As far as I am aware, ALL caching directives are only valid on either a per Server or per Virtual Host basis. I'm sure that this is probably a deliberate security measure, which would prevent someone dropping a htaccess file containing some nasty caching directives into a sensitive directory of a poorly secured web server.

Sorry!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now