WebFaction
Community site: login faq
1
1

A "static only" app can be given the option "expires max" to add far-future caching headers, but on a "symlink to static only" app the "extra info" is taken up with the path to link to.

Is there any way to get the far-future expiry headers on a symlink to static only?

(Of course I could do this through a "symlink to static/php" with a .htaccess. It just seems like the main use-case for the static-only serving is going to be things which need long-lived caching.)

asked 25 Feb '12, 08:47

Neil de Cart...
8115
accept rate: 0%


To do this, you will need to use a "symlink to static/cgi/php" and use .htaccess to set your directives.

permanent link

answered 25 Feb '12, 12:20

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

doesn't this defeat the whole point of 'symbolic link to static only'? Isn't the main benefit in addition to it being fast (cos it uses Nginx (not Apache and no extra weight of having to interpret PHP) is that the files served are "static"... i.e. perfect for LONG "expires" headers, yet... we can't set any so get penalised from Google since this is one of their tests when choosing to rank sites.

(05 Feb '14, 12:13) turgs

I believe this was posted before we added the "expires max" option

(05 Feb '14, 15:05) bmeyer71 ♦♦

So it's still impossible to set expires max on a Symbolic link to static-only app, right? I have several symbolic links to static-only apps set up to serve media, but they don't have far-future expires.

So do I need to set up new static-only apps (not symlinks) and move the content there and then mount them at the old location? Seems overly complicated. As turgs commented, the point of using these symbolic links to static-only apps is to increase speed and performance, but we take a hit from Google because of not having far-future expires.

(04 Jul '14, 16:17) PeterA

Correct: at this time, it's still not possible to configure "expires max" for symlink apps.

(04 Jul '14, 16:32) seanf

OK, would this be the procedure?

  1. Create static-only app with expires max
  2. Move content from existing directory to new static-only app
  3. Mount new static-only app at web location of old directory

And does it matter if we delete the old directory or not? For example if the new app is mounted to mydomain.com/wp-content/uploads/ what happens if there are still files at /home/username/webapps/wordpress_app/wp-content/uploads/ ? Will they be ignored, or do I have to delete them?

(04 Jul '14, 17:44) PeterA

What I recommend is:

  1. Create static-only app with expires max.
  2. Move content from existing directory to new static-only app
  3. Mount new static-only app at web location of old directory
  4. Delete the original directory
  5. Create a symlink in the shell (ie, not a symlink app) to link the static-only app to the original location of the directory, eg: ln -s /home/username/webapps/static_app /home/username/webapps/wordpress_app/wp-content/uploads

This way, things will be the way WordPress expects them to be on the filesystem, so that files uploaded via Wordpress will go into the correct location.

(04 Jul '14, 18:00) seanf
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×125
×12
×9
×8

question asked: 25 Feb '12, 08:47

question was seen: 4,397 times

last updated: 04 Jul '14, 18:00

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM