Solved

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

Posted on 2007-11-18
3
669 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

730 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