?
Solved

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

Posted on 2007-11-18
3
Medium Priority
?
675 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 2000 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

777 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