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
Solved

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

Posted on 2007-11-18
3
668 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

860 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